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<math.h> #include<iostream.h> void main() { int n,i; unsigned long p[10],j; cin>>n; while(n>=1&&n<=10) { for(i=1;i<=n;i++) cin>>p[i]; for(i=1;i<=n;i++) { if(p[i]>=1&&p[i]<=2147483647) { j=((unsigned long)(sqrt(p[i])*sqrt(8))-1)/2; cout<<p[i]-j*(j+1)/2<<endl; } else break; } break; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator