Submission #156372

#TimeUsernameProblemLanguageResultExecution timeMemory
156372DodaAron (COCI17_aron)C++14
50 / 50
2 ms504 KiB
#include <iostream> using namespace std; int main () { int n ; int b = 0; char a[n]; cin >> n ; for (int i = 0; i<n ;i++) { cin >> a [i]; } for (int i=0; i<n ; i++){ if (a [i] != a[i+1]) { b++; } } cout << b+1 ; return 0; }

Compilation message (stderr)

aron.cpp: In function 'int main()':
aron.cpp:8:10: warning: 'n' is used uninitialized in this function [-Wuninitialized]
  char a[n];
          ^
#Verdict Execution timeMemoryGrader output
Fetching results...