#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll getReversedVersion(ll n) {
ll cur = 0;
while ( n >= 1) {
ll temp = n % 10;
cur = (cur * 10) + temp;
n = n / 10; // 1234 / 10 = 123.4 = 123, double n = 1234; n = n / 10; => n = 123.4
}
return cur;
}
int main() {
ll s;
ll e;
ll cur;
cin >> s;
cin >> e;
for (ll i = s; i <= e; i++) {
cur = getReversedVersion(i);
if (cur == i) {
cout << "Palindrome!" << endl; // << “\n”;
}
else {
cout << i << endl;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |