结果是 a/b×100%。
保留 33 位小数即使用 %.3lf
。%% 符号使用 %%
。
为方便计算,可用 doubledouble 类型存储 a,b。
#include<bits/stdc++.h>
using namespace std;
double a, b;
signed main(){
cin>>a>>b;
printf("%.3lf%%",b*100/a);//输出
return 0;
}
结果是 a/b×100%。
保留 33 位小数即使用 %.3lf
。%% 符号使用 %%
。
为方便计算,可用 doubledouble 类型存储 a,b。
#include<bits/stdc++.h>
using namespace std;
double a, b;
signed main(){
cin>>a>>b;
printf("%.3lf%%",b*100/a);//输出
return 0;
}