Pagini recente » Cod sursa (job #2414401) | Cod sursa (job #364335) | Cod sursa (job #528806) | Cod sursa (job #1896316) | Cod sursa (job #1779653)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("adunare.in");
ofstream fout("adunare.out");
string buffer;
string::iterator buffer_it;
int read_int(int &x) {
while ( *buffer_it < '0' || *buffer_it > '9' ) {
++ buffer_it;
}
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 x, y;
x = read_int(x);
y = read_int(y);
fout << x+y << "\n";
return 0;
}