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 |
为什么超时?#include<stdio.h> main() { int t,i,j,sum,a[10]; scanf("%d",&t); for(i=0;i<t;i++) { scanf("%d",&a[i]); sum=0;j=0; while(sum<a[i]) { sum=sum+j; j++; } sum=sum-j+1; if(a[i]-sum!=0) printf("%d",a[i]-sum); else printf("%d",j-1); } getch(); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator