Cod sursa(job #362873)
| Utilizator | Data | 11 noiembrie 2009 10:59:01 | |
|---|---|---|---|
| Problema | A+B | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string p,q;
fstream myfile;
myfile.open ("adunare.in");
getline (myfile,p);
getline (myfile,q);
myfile.close();
int a=0;
stringstream ss(p);
ss >> a;
int b=0;
stringstream pp(q);
pp >> b;
signed int s=a+b;
cout<<s;
if (s<2000000000)
{ofstream write;
write.open ("adunare.out");
write<<s;
write.close();
}
return 0;
} 