Day 1 submission
This commit is contained in:
parent
e5c50e0331
commit
aef9bb0262
|
@ -0,0 +1,20 @@
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int i1, i2, count=0;
|
||||||
|
|
||||||
|
cin >> i1;
|
||||||
|
|
||||||
|
while(cin >> i2)
|
||||||
|
{
|
||||||
|
if (i2 > i1) count++;
|
||||||
|
i1 = i2;
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << count << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int i1, i2, i3, i4, count=0;
|
||||||
|
|
||||||
|
cin >> i1 >> i2 >> i3;
|
||||||
|
|
||||||
|
while(cin >> i4)
|
||||||
|
{
|
||||||
|
if (i2+i3+i4 > i1+i2+i3) count++;
|
||||||
|
i1 = i2;
|
||||||
|
i2 = i3;
|
||||||
|
i3 = i4;
|
||||||
|
}
|
||||||
|
|
||||||
|
cout << count << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue