| ||||||||||
| 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 | |||||||||
Re:哪错了啊 付易懂的程序cIn Reply To:哪错了啊 付易懂的程序c Posted by:mathsoft at 2006-03-03 15:43:53 > #include<stdio.h>
> #include<math.h>
> int main()
> {int i,n;
> long test[10],N;
> double root;
> scanf("%d",&n);
> for(i=0;i<n;i++)
> {scanf("%ld",&test[i]);
> root=(-1.0+sqrt(1+8.0*test[i]))/2;
> N=long(root);
> if((root-N)==0.0) printf("%ld\n",N);
> else printf("%ld\n",long(test[i]-(N*(N+1.0)/2)));
> }
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator