Pagini recente » Cod sursa (job #2370403) | Cod sursa (job #1606128) | Cod sursa (job #1326242) | Cod sursa (job #1436217) | Cod sursa (job #1206207)
// 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;
}