|
#include <stdio.h>
#include <string.h>
int main()
{
char s[10][10]={"0","11","222","3333","44444","555555","6666666","77777777","888888888"};
char s1[11];
long x,i,c=0;
for(x=1212121212;x<9999999999;x++)
{
sprintf(s1,"%ld",x);
for(i=0;i<9;i++)
{
if (strstr(s1,s[i])!=NULL)goto end;//continue;
}
c++;
end:
;}
printf("%d\n",sizeof(long));
printf("%ld\n",c);
return 1;
}
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"g4.c" 21L, 368C 已写入
[oracle@redflag11012501 ~]$ gcc -O2 g4.c
[oracle@redflag11012501 ~]$ ./a.out
8
3110771999
[oracle@redflag11012501 ~]$ |
|