1005
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
unsigned long long n;
scanf("%llu",&n);
unsigned long long m=(unsigned long long)sqrt(n);
if(m*m!=n)
{
printf("%llu",m+1);
}
else printf("%llu",m);
return 0;
}
m使用的是int类型结果数据不够大,2^63开方也有2^32那么大,改成unsigned long long才对
unsigned long long类型的scanf输入是%llu
//1006
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int a,b;
while(scanf("%d %d",&a,&b)!=EOF)
{
double c;
c=sqrt(a*a+b*b);
printf("%.3lf\n",c);
}
return 0;
}
//保留n位小数输出float/double时 %.nf/%.nlf float有7位有效数字,double有16位有效数字
//以某一特定结束符作为终止循环的条件 while(scanf("%d",&n)!=EOF,n!=ascasibkkjhiyg)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float x,y;
while(scanf("%f %f",&x,&y)!=EOF)
{
double z=pow(x,y);
printf("%.3lf\n",z);
}
return 0;
}
//我也不知道错哪里了。。。
标签:%.,20,int,scanf,unsigned,long,1008,1005,include From: https://www.cnblogs.com/Xihuanjuanjuan/p/16710365.html