Code runs perfectly on VS code but throws error on Codeforces. please help. Thanks In Advance.

Revision en1, by Azphyxia, 2022-08-20 09:42:38

include

include

include

using namespace std;

//This is solution to the problem 41A //Please help

int main() { string s1; string s2; char user[]={}; char arr[]={}; cin >> s1; unsigned int last; last = s1.length() — 1 ;

for(int j = 0;j<s1.length();j++)
{
    cin >> user[j];
}

int counter;

for (int q = 0;q<s1.length();q++)
{
   if(user[q]==s1[last - q])
   {
    counter = counter + 1;
   }
}

if (counter == s1.length())
{
    cout << "YES"<< endl;
}
else 
{
    cout << "NO"<< endl;
}

//cout << counter;

}

Tags #41a, #help me, #help, #help error

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Azphyxia 2022-08-20 09:42:38 805 Initial revision (published)