Pagini recente » Cod sursa (job #1206590) | Cod sursa (job #2271049) | Cod sursa (job #268153) | Cod sursa (job #563358) | Cod sursa (job #1139873)
#include <fstream>
#include <string>
using namespace std;
ifstream fin("adunare.in");
ofstream fout("adunare.out");
string buffer;
string::iterator buffer_it;
void read_is32nn( int &x ) { // reads next non-negative 32 bit signed integer;
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;
}
}
int main( ) {
getline(fin, buffer, char(0));
buffer_it = buffer.begin();
int a, b;
read_is32nn(a); read_is32nn(b);
fout << a + b << "\n";
return 0;
}