Cod sursa(job #2377323)
Utilizator | Data | 9 martie 2019 18:08:07 | |
---|---|---|---|
Problema | Jocul Flip | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("flip.in");
ofstream out("flip.out");
int main()
{
int N, M, s=0;
in >> N >> M;
int matrice[N][M];
for (int i=0; i<N; i++)
{
for (int j=0; j<M; j++)
{
in >> matrice[i][j];
if (matrice[i][j]>0)
s=s+matrice[i][j];
}
}
out << s;
}