楼主,我试了下,在vc++ 6.0里包含stdbool.h这个头文件就报错,把他删掉,用o和1来表示假和真
程序代码:
#include<stdio.h> main() { int a[10]={0,0,0,0,0,0,0,0,0,0}; int digit; int n; for(;;) { printf("Enter a number: "); scanf("%d", &n); if(n<=0) break; while(n>0) { digit=n%10; if(a[digit]) break; a[digit]=1; n/=10; } if(n>0) printf("Repeated digit\n"); else printf("No repeated digit\n"); } }
天下寒士俱欢言!!!