Cod sursa(job #2481329)
Utilizator | Data | 26 octombrie 2019 19:04:27 | |
---|---|---|---|
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 fin("flip.in");
ofstream fout("flip.out");
int main()
{
int n, m, x;
long long s=0;
fin >> n >> m;
int l=m;
while(n)
{
while(m)
{
fin >> x;
if(x>0)
s+=x;
m--;
}
n--;
m=l;
}
fout << s;
return 0;
}