Submission #1691259
Source Code Expand
int main() { string s = "ABCDE"; char c; cin >> c; int l = s.length(); for (int i = 0; i < l; i++) { if (s[i] == c) { cout << i + 1 << endl; } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - A |
User | nomi |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 227 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:2:5: error: ‘string’ was not declared in this scope string s = "ABCDE"; ^ ./Main.cpp:4:5: error: ‘cin’ was not declared in this scope cin >> c; ^ ./Main.cpp:6:13: error: ‘s’ was not declared in this scope int l = s.length(); ^ ./Main.cpp:9:13: error: ‘cout’ was not declared in this scope cout << i + 1 << endl; ^ ./Main.cpp:9:30: error: ‘endl’ was not declared in this scope cout << i + 1 << endl; ^