about summary refs log tree commit diff
path: root/others/easy20160714/21.c
blob: 53951a1171d6a804ee9e89181a8d1dda257dda1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>

int main()
{
	FILE * f = fopen("INP.TXT", "r");
	int n, i, preva, a, r = 1;

	fscanf(f, "%d", &n, &preva);
	for (i = 1; i < n; i++) { 
		fscanf(f, "%d", &a);
		if (a > preva)
			r++;
		preva = a;
	}

	fclose(f);

	f = fopen("OUT.TXT", "w");
	fprintf(f, "%d\n", r);
	fclose(f);

	return 0;
}