| ||||||||||
| 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:求解!!In Reply To:求解!! Posted by:cugwei at 2004-04-24 11:56:44 > #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