题解 | 特殊的科学计数法
特殊的科学计数法
https://www.nowcoder.com/practice/ca0962879d3b40d8bb598fb9a905ac7a
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 0x3f3f3f3f3f3f3f3f;
void solve(){
string s;cin>>s;
int cnt=s.length()-1;
if(s[2]>='5'){
if(s[1]=='9'){
s[1]='0';
if(s[0]=='9'){
s[0]='1';
cnt++;
}
else s[0]++;
}
else s[1]++;
}
cout<<s[0]<<"."<<s[1]<<"*10^"<<cnt;
}
signed main(){
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int t=1;
// cin>>t;
while(t--){
solve();
}return 0;
}
