#include<iostream>
#include<algorithm>
using namespace std;
long long longg(long long i)
{
int a = 0;
while(i)
{
i /= 10;
a++;
}
return a;
}
long long turnnn(string s)
{
long long k = 0;
for (int i = 0; i < s.size(); i++)
{
k += (s[i] - '0') * pow(10, s.size() - i - 1);
}
return k;
}
string turnn(long long a)
{
int l = longg(a);
string s;
for (int i = 0; i < l; i++)
{
int c = a % 10;
char d = c + '0';
s.push_back(d);
a /= 10;
if (l == 1)
{
s.push_back('0');
}
}
reverse(s.begin(), s.end());
return s;
}
int main()
{
string k;
cin >> k;
string kk(k.begin(),k.end()-1);
long long a = turnnn(k);
k += kk;
for(int i=2;i<=kk.size()+1;i++)
{
long long p = i * a;
string s1 = turnn(i * a);
if(k.find(s1)==string::npos)
{
cout << "No" << endl;
return 0;
}
}
cout << "Yes" << endl;
return 0;
}
HNU软件实训-循环数(有缺陷)
最新推荐文章于 2024-08-21 18:16:36 发布