[C++] Palindrom - Tutoriale si exercitii - GAMELIFE România Jump to content

Recommended Posts

  • Members
Posted

Salut, in codul urmator o sa va arat cum se afla daca un numar este palindrom

#include<iostream.h>
int n,inv, c, copie;
int main()
{
cout<<„n=”;
cin>>n;
copie=n;
while(n!=0)
{
c=n%10;
inv=inv*10+c;
n=n/10;
}
if(copie==inv)
cout<<„Palindrom”;
else
cout<<„Nu”;
}

 

eyixmpi.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...

Important Information