Cod sursa(job #473714)

Utilizator olly2204Olly2204 olly2204 Data 31 iulie 2010 13:26:37
Problema Jocul Flip Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
// flip


#include <iostream>
#include <fstream>
using namespace std;

ifstream f("flip.in");
ofstream g("flip.out");



int main()
{
	int n,m,x,s,y =0;

	f >> n >>m;

	for (int i=1; i<n; i++){
		s= 0;
		for (int j=1; j<m; j++){
			f >> x;
			s += x;}
		if (s<0) {
			s = -s;}
		y +=s;
	}

	g << y;
	f.close();
	g.close();
		
	return 0;
}