Mai intai trebuie sa te autentifici.
Cod sursa(job #2021240)
Utilizator | Data | 12 septembrie 2017 22:12:46 | |
---|---|---|---|
Problema | A+B | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<iostream>
#include<fstream>
#include<string>
int main()
{
std::ifstream ifs("adunare.in", std::ifstream::in);
std::ofstream ofs("adunare.out", std::ofstream::out);
std::string val1, val2;
if (ifs.is_open())
{
std::getline(ifs, val1);
std::getline(ifs, val2);
}
if (std::stoll(val1) < 2000000000 && std::stoll(val2) < 2000000000)
{
long int rez = std::stoll(val1) + std::stoll(val2);
ofs << rez;
}
ifs.close();
ofs.close();
return 0;
}