Submission #213701
Source Code Expand
#include <iostream> #include <string> using namespace std; int main(){ string str = "ABCDE"; char s; cin >> s; int count = 0; for (auto &a : str){ count++; if (a == s){ break; } } cout << count << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - A |
User | ads100 |
Language | C++ (G++ 4.6.4) |
Score | 0 |
Code Size | 261 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:13:13: error: ISO C++ forbids declaration of ‘a’ with no type [-fpermissive] ./Main.cpp:13:17: error: range-based-for loops are not allowed in C++98 mode