Submission #471507

# Submission time Handle Problem Language Result Execution time Memory
471507 2021-09-09T15:24:46 Z rainboy Aron (COCI17_aron) C
50 / 50
1 ms 276 KB
#include <stdio.h>

int main() {
	int n, ans;
	char c;

	scanf("%d", &n);
	c = '?', ans = 1;
	while (n--) {
		static char s[2];

		scanf("%s", s);
		if (c != s[0])
			c = s[0], ans++;
	}
	printf("%d\n", ans);
	return 0;
}

Compilation message

aron.c: In function 'main':
aron.c:7:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
aron.c:12:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%s", s);
      |   ^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 272 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 276 KB Output is correct
9 Correct 0 ms 276 KB Output is correct
10 Correct 1 ms 268 KB Output is correct