|
|
1.1 ! root 1: #include <stdio.h> ! 2: float fract = 2; ! 3: double atof(), frand(); ! 4: long time(); ! 5: int eflag; ! 6: char line[BUFSIZ]; ! 7: main(argc,argv) char **argv; ! 8: { ! 9: int i,c; ! 10: for(i=1;i<argc;i++) ! 11: { if(*argv[i]!='-') ! 12: fract=atof(argv[i]); ! 13: else if((c=argv[i][1])=='e') ! 14: eflag=1; ! 15: } ! 16: srand((int)time(0)); ! 17: if(eflag==0) ! 18: while(gets(line)) { ! 19: if(frand()*fract<1) ! 20: puts(line); ! 21: } ! 22: else ! 23: return(nrand((int)fract)); ! 24: return(0); ! 25: } ! 26:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.