| ||||||||||
| 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 | |||||||||
请问1019这样做错在哪里?#include<stdio.h>
#include<math.h>
#define N 10
int main()
{
int n,i;
unsigned long m[N],y,x;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%ld",&m[i]);
for(i=0;i<n;i++)
{
x=sqrt(2*m[i]);
y=x*(x+1)/2;
if(y-m[i]>=0)
m[i]=x-y+m[i];
else
m[i]=m[i]-y;
}
for(i=0;i<n;i++)
printf("%ld\n",m[i]);
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator