Submission details
Task:Palindromi
Sender:poppendop
Submission time:2025-11-11 10:17:54 +0200
Language:C++ (C++17)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:9:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for (int i=0; i<(x.length()/2),i+1) {
      |                   ~^~~~~~~~~~~~~~~
input/code.cpp:9:20: warning: value computed is not used [-Wunused-value]
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] {
      |            ^
      |            (

Code

#include <iostream>

using namespace std;

int main() {
    string x;
    int y = 0;
    cin >> x;
    for (int i=0; i<(x.length()/2),i+1) {
        if x[i] != x[x.length-i] {
            y++;
        };
    };
    cout << y;
}