题解 | #提取不重复的整数#
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
#include <stdio.h> int main() { int a, b; char ch = 0; char chArry[10] = {0}; char outArry[10] = {0}; int ArryLen = 0; int strLen = 0; memset(chArry,0x00,10); scanf("%s",chArry); strLen = strlen(chArry); for(int i = strLen -1; i >= 0; i--) { ch = chArry[i]; for(int i = 0; i < 10; i++) { if(outArry[i] == ch) break; if(outArry[i] == 0) { outArry[i] = ch; ArryLen++; break; } } } for(int i = 0; i < ArryLen; i++) { printf("%c",outArry[i]); } return 0; }