Redefined gets() so that the code can refer to gets() not fgets(). That change was useful (as noted before) for preventing an annoying warning being interspersed with the output and warnings at compiler and/or linking.
36 lines
2.2 KiB
C
36 lines
2.2 KiB
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
#define gets(x) fgets((x), 111, stdin)
|
|
#define iii\
|
|
( I ) if ( ii(I,6\
|
|
) )I [ strlen(I ) -1]=!1
|
|
int ii(ll,lll ) char*ll; {
|
|
|
|
char *l="\"; !l ? 1.1 : l; l,printf(";int l1=1-/*+&|"); &+|-*/1,li=!1;while
|
|
|
|
( lll>l1 ) li|=! ( l[3*l1+++3
|
|
] -ll[strlen ( ll)-1] ) ;return
|
|
( li ) ;}main ( ll,lll
|
|
) char*lll[];{char l1 [ 111][21],li1[111][21 ] ,il1[111],i1l
|
|
[ 111 ] ;int lli,l11,l1l,li/* ( */,ll1,il,l;FILE*f;if(ll-2
|
|
) {f=fopen ( lll[1],"r" ) ;lli=l=ll1=il=!1;while
|
|
( fscanf(f,"%s",l1[lli] ) +1){li=ii ( l1[lli],3
|
|
) ;iii ( l1[lli] ) ;l1l=l11=!1;while
|
|
( l1l>-ll ) {iii ( lll[-l1l]
|
|
) ;strcasecmp ( lll[-l1l--],l1[lli] ) ||
|
|
( l11=++il ) ;}l11||lli++;if ( li
|
|
) {if ( ll1<il ) {ll1=il;l1l=l=lli;while
|
|
( l1l-- ) strcpy ( li1[l1l],l1[l1l]
|
|
) ;}il=lli=!1;}}if ( !ll1 ) puts
|
|
( " Beats me." ) ;else if ( !l
|
|
) puts ( " Yes." ) ;else{*li1[l1l=!1]=toupper
|
|
( *li1[!1] ) ;while ( l>l1l
|
|
) printf ( " %s",li1[l1l++] ) ;puts
|
|
( "." ) ;}}else{sprintf ( il1,"cat %s;echo",lll[1]
|
|
) ;system ( il1 ) ;}printf
|
|
( "\n? " ) ; gets ( il1
|
|
) ;sprintf ( i1l,"%s %s %s",lll[!1 ] ,lll[1],il1);system
|
|
( i1l); }
|