Cod sursa(job #2976448)

Utilizator dantedapecappillopaTegzes dantedapecappillopa Data 9 februarie 2023 10:40:04
Problema Jocul Flip Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <iostream>
#include <fstream>

std::ifstream fin("fisier.in");
std::ofstream fout("fisier.out");

int main()
{
    int a[50][30], N, M, s = 0;
    fin >> N >> M;
    for(int i = 0; i < N; i++)
        for(int j = 0; j < M; j++)
        {
            fin >> a[i][j];
            if(a[i][j] > 0)
                s += a[i][j];
        }
    fout << s;

    return 0;
}