Submission #2994914


Source Code Expand

#include <iostream>
#include <string>

using namespace std;
int main(){
string s;
cin >> s;

int ans=0;
char x = s[0];
for(auto i=s.begin();i<s.end();i++){
if((*s)==x){
continue;
}else{
x=(*s);
ans++;
}
}
cout << ans;

return 0;}

Submission Info

Submission Time
Task C - 1D Reversi
User saikoumi
Language C++14 (GCC 5.4.1)
Score 0
Code Size 253 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:12:5: error: no match for ‘operator*’ (operand type is ‘std::string {aka std::basic_string<char>}’)
 if((*s)==x){
     ^
./Main.cpp:15:4: error: no match for ‘operator*’ (operand type is ‘std::string {aka std::basic_string<char>}’)
 x=(*s);
    ^