Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
无意吐槽……一道这么水的题竟害我WA两次……#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator