Pagini recente » Cod sursa (job #972809) | Cod sursa (job #1172946) | Cod sursa (job #1796473) | Cod sursa (job #2699446) | Cod sursa (job #949513)
Cod sursa(job #949513)
#include <fstream>
#include <limits>
using namespace std;
int main(int argc, const char * argv[]) {
int n, m;
long max = 0;
ifstream input ("flip.in");
ofstream output ("flip.out");
input >> n >> m;
for (int i = 0; i < n; i++) {
long current_max = -std::numeric_limits<int>::max();
long current;
for (int j = 0; j < m; j++) {
input >> current;
current_max = current_max > current ? current_max : current;
}
max += current_max;
}
input.close();
output.close();
return 0;
}