Pagini recente » Cod sursa (job #143705) | Cod sursa (job #2173575) | Cod sursa (job #140094) | Cod sursa (job #1884800) | Cod sursa (job #1205977)
// bla.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#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;
}
}
int main()
{
citire();
rezolvare();
system("pause");
return 0;
}