Created
September 24, 2017 17:44
-
-
Save invatainfo/6645d89a1d6a5cfd2839508874f4fa57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
int main() { | |
ifstream f("date.in"); | |
int prec,a,urm,nr = 0; | |
f >> a; | |
prec = -1; | |
while (f >> urm) { | |
if (a < prec + urm && prec != -1) | |
nr++; | |
prec = a; | |
a = urm; | |
} | |
cout << nr; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment