题解 | #提取不重复的整数#
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
int main() { int a[1000], b, i = 0, j, k,m=0; long int n = 0; scanf("%ld", &n); while (n != 1) { a[i] = n % 10; n = n / 10; i++; if (n < 10) { a[i] = n; i++; break; } } printf("%d", a[0]); for (j = 1; j < i; j++) { for (k = 0; k < j; k++) { if (a[k] == a[j]) { m++; } } if (m == 0) { printf("%d", a[j]); } m = 0; } return 0; }