#include <bits/stdc++.h> using namespace std; int flag=0; string addString1(string a,string b)//等长字符串加法,小数 { string res; int carry=0; for(int i=a.length()-1;i>=0;i--) { int num=a[i]-'0'+b[i]-'0'+carry; res+=num%10+'0'; carry=num/10; } if(carry==1) flag=1;//两者区别在这,这里表示小数最后进位1的处理 reverse(res.begin(),res.end()); return res; } string addString2(string a,string b)//等长字符串加法,整数 { string res; int carry=flag; for(int i=a.length()-1;i>=0;i--) { int num=a[i]-'0'+b[i]-'0'+carry; res+=num%10+'0'; carry=num/10; } if(carry==1) res+='1'; reverse(res.begin(),res.end()); return res; } int main(){ string s1,s2; while(cin>>s1>>s2) { //整数和小数分离,分别计算 string x1,x2,y1,y2; int pos1=s1.find('.'); int pos2=s2.find('.'); x1=s1.substr(0,pos1); y1=s1.substr(pos1+1); x2=s2.substr(0,pos2); y2=s2.substr(pos2+1); //找出长的,换到x1,y1,明确了x1,y1长 if(x1.length()<x2.length()) swap(x1,x2); if(y1.length()<y2.length()) swap(y1,y2); //对短的补长对齐 x2.insert(0,x1.length()-x2.length(),'0'); y2.insert(y2.length(),y1.length()-y2.length(),'0'); y1=addString1(y1,y2); x1=addString2(x1,x2); //删除小数末尾的'0' for(int i=y1.size()-1;i>=0;i--) { if(y1[i]=='0') y1.erase(i,1); else break; } cout<<x1<<'.'<<y1<<endl; } return 0; }