标签:
#include <stdio.h> #include <stdlib.h> typedef int BOOL; #define true 1 #define false 0 int main() { BOOL digit_seen[10] = {false}; int digit; long int n; printf("Enter a number:"); scanf("%ld",&n); while(n > 0) { digit = n % 10; if(digit_seen[digit]) { break; } digit_seen[digit] = true; n /= 10; } if(n > 0) { printf("Repeated digit. \n"); } else printf("No repeated digit\n"); system("pause"); return 0; }
标签:
原文地址:http://www.cnblogs.com/joyclub/p/4471615.html