ok呀,大家好,我是杜某某,来看一下新手都会的c++题目吧:
上代码:
#include <stdio.h>
int main()
{
int a, b;
scanf("%d %d", &a, &b);
double c;
c=1.0*a/b;
printf("%.9lf", c);
return 0;
}
c*1.0是因为a/b是整数,*1.0后就是小数了。
制作不易,点个赞叭~
ok呀,大家好,我是杜某某,来看一下新手都会的c++题目吧:
上代码:
#include <stdio.h>
int main()
{
int a, b;
scanf("%d %d", &a, &b);
double c;
c=1.0*a/b;
printf("%.9lf", c);
return 0;
}
c*1.0是因为a/b是整数,*1.0后就是小数了。
制作不易,点个赞叭~