#include<iostream>
#include<string>
using namespace std;
int n;
string deal(string s,int &e){
int k=0;
while(s.length()>0&&s[0]=='0')
s.erase(s.begin());
if(s[0]=='.'){
s.erase(s.begin());
while(s.length()>0&&s[0]=='0'){
s.erase(s.begin());
e--;
}
}
else{
while(k<s.length()&&s[k]!='.'){
k++;
e++;
}
if(k<s.length()){
s.erase(s.begin()+k);
}
}
if(s.length()==0){
e=0;
}
string res;
for(int i=0;i<n;i++){
if(i<s.length())
res+=s[i];
else
res+='0';
}
return res;
}
int main(){
string s1,s2,s3,s4;
cin>>n>>s1>>s2;
int e1=0,e2=0;
s3=deal(s1,e1);
s4=deal(s2,e2);
if(s3==s4&&e1==e2)
cout<<"YES 0."<<s3<<"*10^"<<e1<<endl;
else
cout<<"NO 0."<<s3<<"*10^"<<e1<<" 0."<<s4<<"*10^"<<e2<<endl;
return 0;
}
PATA1060
最新推荐文章于 2021-08-23 11:44:19 发布