/* IOCCC 26 */ #include #include #include #include #include #include static int o(uintmax_t n) { uintmax_t i, x; if (n==2 || n==3) return 1; if (n<2 || !(n%2) || !(n%3)) return 0; i = 5; x = 2 ; while (i * i <= n) { if (!(n%i)) return 0; i += x; x = 6 - x;} return 1; }int main(int n, char **v) { int i;uintmax_t l [2]={0},m[2]={*l},x=*m,c[ 2]={ *m},w[2]={*c},V=*w,t=*l,P=*m,d[ 2]={*w},y=x; FILE *f=0; char *W= 0,*I=basename(*v);n=0;V=*I== '1'; if (!1[v]) { f=stdin;W =""; goto dO; } Do:while (f|| *++ v) goto dO ;goto whilE;dO:do{errno = 0 ;if (f||(f=** v== '-'?stdin : fopen(*v,"r"))) { *d = 0 ;++n,x=*m= (1?(n?P:1) : 0 ) ; while((i=fgetc( f)) != EOF){ ++* c ;x += i=='\t'&& 1 -1==0? (8-x%8):0; if(i == '\n'||i== '\r'|| i== '\f'){(i =='\n'&&(*l=*l +1));*d =*m!=x&&* l>1 ? 1:*d;*m=x> *m ?x: *m; x = P^0 ;}else if(isprint (i))++x;if(isspace (i)) t ^=t;else if (!t)t^=!t ,*w+=t;}printf("%5zu%s" " %5zu%s %5zu%s %5zu%s" " %5s%2s",*l,o(*l)?"*": " ", *w,o(*w)?"*":" ",* c,o(*c)?"*":" ",*m,o(*m)?"*" : " ",W?W:*v,*d?" " :"+") ;(V && (((*l>L||* c>C)&& printf (" (no)"))||printf(" (yes)")) ) ;printf("\n");(f!=stdin &&fclose(f),f =0); 1[l]+=l[0],*l*=P; c[1]+=0[c],*c*=*l; 1[w]+=w [0],*w*=*c; m[1]=*m>1[m]?*m:m[1]; (n>1&&(1[m]!= *m||*d)&&(y = 1)) ; } else if (errno) fprintf(stderr , "%s: %s: %s\n", I, W?"stdin":*v?*v : "",strerror(errno) ) ;goto Do; } while (1) ;whilE : (n > 1 && printf( "%5zu%s %5zu%s " "%5zu%s %5zu%s " "total%2s\n", l[ 1 ], o(l[1])?"*":" " ,w[1],o(1[w])?"*" :" ",c[1],o(1[c]) ? "*": " ",1[m], o(m [1]) ? "*" : " ", y ? " " : "+"));} /* exit(EXIT_PRIME_TIME_PRIME_LINE); */