Cod sursa(job #2930330)

Utilizator gheorghelupu171Gheorghe Lupu gheorghelupu171 Data 28 octombrie 2022 01:38:24
Problema A+B Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.31 kb
#include <iostream>
#include <fstream>
using namespace std;

int main() {

    string line;
    ifstream fin("adunare.in");
    int sum = 0;
    while (getline(fin,line)){
        int number = stoi(line);
        sum += number;
    }
    ofstream fout("adunare.out");
    fout <<sum;
    fin.close();
    return 0;
}