Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

无意吐槽……一道这么水的题竟害我WA两次……

Posted by 1200017623 at 2013-01-16 00:39:56 on Problem 3086
#include<iostream>
using namespace std;
int main(){
	int count;
	int n;
	scanf("%d",&count);
	for(int i = 1;i <= count;++i){
		scanf("%d",&n);
		printf("%d %d %lld\n",i,n,((long long)n*(n+1)*(n+2)*(n+3)/8));      //要类型转换!n*(n+1)*(n+2)*(n+3)已经越界了
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator