题解 | 特殊的科学计数法
特殊的科学计数法
https://www.nowcoder.com/practice/ca0962879d3b40d8bb598fb9a905ac7a
#include <bits/stdc++.h>
using namespace std;
int main() {
//输入字符串, 前一位和第三位小数点四舍五入,乘以字符串长度-1
//输入
string s;
cin >> s;
//a
double a = s[0]-'0'+0.1*(round(s[1]-'0'+0.1*(s[2]-'0')));
//c
int c = s.size() -1;
//输出
if(a >=10) {
a/=10;
c++;
}
printf("%.1f*10^%d", a, c);
return 0;
}
// 64 位输出请用 printf("%lld")

查看29道真题和解析