Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- int n, c, numar, invers, y;
- cout << "n = ";
- cin >> n;
- for (int i=1; i<=n; i++) {
- cout << "numar = ";
- cin >> numar;
- invers=0;
- y=numar;
- while (numar!=0) {
- c = numar % 10;
- invers=invers*10+c;
- numar /= 10;
- }
- if (y==invers)
- cout << "Numarul " << invers << " este palindrom." << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement