Cod sursa(job #2658408)

Utilizator predamPreda M. predam Data 13 octombrie 2020 21:27:18
Problema A+B Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <iostream>
#include <fstream>
using namespace std;

int main(int argc, char const *argv[])
{
    int rez = 0;
    string line;
    ifstream in ("adunare.in");
    if (in.is_open())
    {
        while (getline(in, line))
        {
            rez += stoi(line);
        }
    }
    in.close();

    ofstream ot ("adunare.out");
    if (ot.is_open())
    {
       ot << rez;
       ot.close();
    }

}