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<stdio.h> int a[100]; __int64 fun1(int t) {__int64 r=1; int i; for(i=1;i<=t;i++) r*=2; return r; } __int64 fun2(int t) {__int64 r=0; int i; for(i=0;i<t;i++) r+=i; return r; } __int64 cymx(int t) { __int64 r; r=fun1(t)-fun2(t); return r; } __int64 main() { int m; int i; scanf("%d",&m); for(i=1;i<=m;i++) { scanf("%d",&a[i]);} for(i=1;i<=m;i++) printf("\nScenario #%d:\n%I64d\n",i,cymx(a[i])); printf("\n"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator