solved beautiful days at the movies
Signed-off-by: ayham <altffour@protonmail.com>
This commit is contained in:
parent
79297f1383
commit
f1f1f52eb2
|
@ -0,0 +1,17 @@
|
|||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int reverse(int num) {
|
||||
string tmp = to_string(num);
|
||||
reverse(tmp.begin(), tmp.end());
|
||||
return stoi(tmp);
|
||||
}
|
||||
|
||||
int main() {
|
||||
int i, j, k, res = 0;
|
||||
cin >> i >> j >> k;
|
||||
for (; i <= j; i++)
|
||||
if (abs(i-reverse(i)) % k == 0) res++;
|
||||
cout << res << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue