51nod 1016 水仙花数

时间:2023-02-04 16:36:21

大水仙花数模板+1……

#include<stdio.h>
#include<math.h>
#include<queue>
#include<vector>
#include<stack>
#include<set>
#include<string.h>
#include<iostream>
#include<algorithm>
#define MAXSIZE 1000005
#define LL long long
#define INF 0x3f3f3f3f
using namespace std; string s[] = {"","","","","","","","","","","","","","","",
"","","","","","","","","","",
"","","","","","","",
"","","","","","",
"","","","","",
"","","","",
"","","","",
"","","",
"","","",
"","","",
"","","",
"","","",
"","","",
"","","",
"","",
"","",
"","",
"","",
"","",
"","",
"","",
"","",
""}; bool Cmp(string temp,string s)
{
int Size_t = temp.size();
int Size_s = s.size();
if(Size_t > Size_s)
return false;
if(Size_t < Size_s)
return true;
for(int i=;i<Size_s;i++)
{
if(temp[i] > s[i])
return false;
if(temp[i] < s[i])
return true;
}
return true;
} int main()
{
string str;
cin >> str;
bool ok = false;
for(int i=;i<;i++)
{
// cout << s[i] << endl;
if(Cmp(str,s[i]))
{
cout << s[i] << endl;
ok = true;
break;
}
}
if(!ok)
cout << "No Solution" << endl;
return ;
}