| Task: | Palindromi |
| Sender: | poppendop |
| Submission time: | 2025-11-11 10:16:45 +0200 |
| Language: | C++ (C++17) |
| Status: | COMPILE ERROR |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:7:5: error: expected initializer before 'int'
7 | int y
| ^~~
input/code.cpp:9:22: error: 'x' was not declared in this scope
9 | for (int i=0; i<(x.length()/2),i+1) {
| ^
input/code.cpp:9:39: error: expected ';' before ')' token
9 | for (int i=0; i<(x.length()/2),i+1) {
| ^
| ;
input/code.cpp:10:12: error: expected '(' before 'x'
10 | if x[i] != x[x.length-i] {
| ^
| (
input/code.cpp:14:13: error: 'y' was not declared in this scope
14 | cout << y;
| ^Code
#include <iostream>
using namespace std;
int main() {
string x
int y
cin >> x;
for (int i=0; i<(x.length()/2),i+1) {
if x[i] != x[x.length-i] {
y++;
};
};
cout << y;
}