33,008
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <math.h>
int main()
{
int pos = 0;
long temp = 0;
double dst[70000];
while(scanf("%ld", &temp) != EOF)
dst[pos++] = sqrt((double)temp);
while(pos--)
printf("%0.4lf\n", dst[pos]);
return 0;
}
#include<stdio.h>
#include<math.h>
int main()
{
long long data;
while (~scanf("%lld", &data))
{
double ans = sqrt(data);
printf("%.4lf\n", ans);
}
return 0;
}
long 和int的范围一样,肯定存不下10^18次方,还有就是读到输入结束符才结束,所以你开的70000有可能会小