牛客编程题(C语言):HJ9 提取不重复的整数
作者:互联网
https://www.nowcoder.com/exam/oj/ta?tpId=37
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
提交代码
#include <stdio.h>
int main(void){
int n,a,res=0;
scanf("%d",&n);
int list[10]={0};
while(n>0){
a = n%10;
if(list[a]==0){
list[a] =1;
res *= 10;
res += a;
}
n /= 10;
}
printf("%d",res);
return 0;
}
执行结果
标签:10,www,int,res,HJ9,C语言,牛客,list,https 来源: https://www.cnblogs.com/tsuish/p/16274910.html