Cod sursa(job #1206207)
| Utilizator | Data | 9 iulie 2014 09:59:06 | |
|---|---|---|---|
| Problema | Jocul Flip | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
// bla.cpp : Defines the entry point for the console application.
//
#include<iostream>
#include<fstream>
#define nmax 10000
using namespace std;
ifstream f("date.in");
ofstream g("date.out");
int m,n;
long long a[nmax][nmax];
void citire()
{
int i,j;
f>>m>>n;
for(i=1;i<=m;++i)
for(j=1;j<=n;j++)
f>>a[i][j];
}
void rezolvare()
{
int i,j,s=0,tot=0;
for(i=1;i<=m;++i)
{
for(j=1;j<=n;j++)
s+=a[i][j];
if(s<0)
tot+=s;
}
g<<tot;
}
int main()
{
citire();
rezolvare();
system("pause");
return 0;
}
