제출 #83750

#제출 시각아이디문제언어결과실행 시간메모리
83750MatesV13Aron (COCI17_aron)C++14
15 / 50
3 ms600 KiB
#include<bits/stdc++.h>

using namespace std;
 
int n, x=1;
char str[27];
 
int main (){
	cin >> n;
if (n>1)
	for (int i=0;i<n;i++)
		cin >> str[i];
	for (int i=1 ; i < n ; i++){
	    if (str[i] == str[i-1]) continue;
	    else x++;
	}
	if (str[n-1] == str[n-2]) x++;
else if (n==1) x++;
cout << x;
return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

aron.cpp: In function 'int main()':
aron.cpp:10:1: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
 if (n>1)
 ^~
aron.cpp:13:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (int i=1 ; i < n ; i++){
  ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...