菜鸟教程https://www.runoob.com/cprogramming/c-function-isprint.html
isalpha(ch)
isdigit(ch)
isupper(ch)
islower(ch)
toupper(ch)
tolower(ch)
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<ctype.h>
using namespace std;
const int maxn=10010;
const char* rev="A 3 HIL JM O 2TUVWXY51SE Z 8 ";
const char* msg[]={"not a palindrome.",
"a regular palindrome.",
"is a mirrored string.",
"is a mirrored palindrome."};
char r(char ch){
if(isalpha(ch)) return rev[ch-'A'];
else return rev[ch-'0'+25];
}
int main(){
char s[maxn];
while(scanf("%s",s)==1){
int m=1,p=1;
int len=strlen(s);
for(int i=0;i<(len+1)/2;i++){
if(s[i]!=s[len-1-i]) p=0;
if(r(s[i])!=s[len-1-i]) m=0;
}
printf("%s -- is %s\n\n",s,msg[m*2+p]);
}
}
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#define maxn 100005
using namespace std;
int ans[maxn];
int main(){
memset(ans,0,sizeof(ans));
for(int m=1;m<maxn;m++){
int x=m,y=m;
while(x>0){ y+=x%10; x/=10; }
if(ans[y]==0||m<ans[y]) ans[y]=m;
}
int T,n;
scanf("%d",&T);
//while(T--)
do{
//scanf("%d",&n);
printf("%d-------%d\n",T,ans[T]);//输入一个数,输出这个数的最小元
}while(T--);
}