Pagini recente » Cod sursa (job #1266627) | Cod sursa (job #2488599) | Cod sursa (job #3171034) | Cod sursa (job #2632006) | Cod sursa (job #1376745)
#include <fstream>
using namespace std;
ifstream fin("adunare.in");
ofstream fout("adunare.out");
string buffer;
string::iterator buffer_it;
int read_int( ) {
while ( *buffer_it<'0' || *buffer_it>'9' ) {
++buffer_it;
}
int x = 0;
while ( *buffer_it>='0' && *buffer_it<='9' ) {
x = x*10+*buffer_it-'0';
++buffer_it;
}
return x;
}
int main( ) {
getline(fin, buffer, (char)0);
buffer_it = buffer.begin();
int a = read_int(), b = read_int();
fout << a+b << "\n";
return 0;
}