文章
27
粉丝
0
获赞
130
访问
8.3k
#include<bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin>>a>>b>>c;
// printf("%.*lf", c, ((double)a / (double)b));//会超出double表示范围
string res;
int temp;
if(a < b) {
res += '0';
res += '.';
} else {
temp = a / b;
a = a % b;
res += to_string(temp);
res += '.';
}
c++;
while(c--) {
a *= 10;
temp = a / b;
res += to_string(temp);
...
登录后发布评论
暂无评论,来抢沙发