p2.cpp
1 #include <iostream> 2 #include <fstream> 3 4 using namespace std; 5 6 int main() { 7 int total = 0; 8 int a = 0, b = 0, c = 0, d = 0; 9 int rownumber = 0; 10 11 while (cin >> d) { 12 if (rownumber >= 3) { 13 if (a + b + c < b + c + d) { 14 total++; 15 } 16 } 17 rownumber++; 18 a = b; 19 b = c; 20 c = d; 21 } 22 23 cout << total << endl; 24 return 0; 25 }