Submission #471507

#TimeUsernameProblemLanguageResultExecution timeMemory
471507rainboyAron (COCI17_aron)C11
50 / 50
1 ms276 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...