- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- char s[5];
- int x=0,y=0,n=0;
- while((s[n]=getchar())!='+')
- {
- x=x*10+s[n]-'0';
- n++;
- }
- while((s[n]=getchar())!='\n')
- {
- y=y*10+s[n]-'0';
- n++;
- }
- cout<<x+y;
- return 0;
- }
来源: http://www.bubuko.com/infodetail-2588815.html