The first version uses fgets(3). This version will compile (note that it does not compile right away: one has to make other adjustments; it is not a matter of just changing the code to use fgets()!) but when fed its own source code it will not generate code that can be compiled let alone use fgets(3). The second version, schnitzi.alt2.c, has an increased buffer size but it will not generate code with the same buffer size; rather the size will be the original. I explain this in detail (did this quite some time back) in the bugs.md file. I noticed today that the author gives quite some details too which will be something I can look at later on. Right now it's more important to get the website in order so that the next contest can run! I will only look at this later on or else at a time where I am unable to do the more important work but am able to do this (though I don't know about that happening it is still something that theoretically could happen). The alt code already existed but it was changed to the second version as the goal is to get it to use fgets(3) regardless of the buffer size. Note that the other functionality of both alt versions is not affected. More updates to bugs.md for this and the thanks file has had the entry added to it (which should have been done earlier on but was neglected due to the way it came about, the alt code).
53 lines
2.2 KiB
C
53 lines
2.2 KiB
C
#include <stdio.h>
|
|
int r=0,x,y=0, /*
|
|
nt /
|
|
c
|
|
lx /\ / \ /|\ /|\
|
|
u, \/ \\/ \-/ \ /
|
|
dn ]
|
|
e= ||| /|\ /\ /\ = p p
|
|
0 \/ \ / ||| \/ f f f r r
|
|
<, tw t s s i i
|
|
sy || /|\ /\ i eh e e c n n
|
|
t= /- \ / ||| n li l e a t t
|
|
d0 ||| t ll l {< k n f f
|
|
i, || /|\ /|\ (e s ( fr ( f ( (
|
|
o _ ||\ \ / \-/ tu s( t usw o; i s ( " "
|
|
. || - / c [[ tg rv [th rx=f t " % \
|
|
h mh111 de{l) +di (+'( d+% c n+
|
|
> aa000 itte; > +il x+ n inc " "+
|
|
/ ir000[ns[nytyrrne<=)'<xn," , );
|
|
*/ n = 0 ;
|
|
main ( ) {
|
|
char v [
|
|
1000 ] , s;
|
|
int t[100 ] ,
|
|
u[100 ] ; u
|
|
[ 0
|
|
]=ftell(stdin ) ;
|
|
while(fgets(v,100,stdin )&&((v[strlen(v)-1]='\0',1)) )
|
|
{t [ r ]=
|
|
strlen (
|
|
v);y=
|
|
t[ r ]
|
|
>y ? t [
|
|
r ] : y;
|
|
u[++r ] =
|
|
ftell(stdin ) ; }
|
|
while ( n
|
|
< y )
|
|
{for(x=0 ; x
|
|
<r;x++) { s
|
|
=' ' ;
|
|
if(n< t [
|
|
x ] ) {
|
|
fseek(stdin ,u [ x ]
|
|
+n , 0 ) ;
|
|
scanf("%c", &
|
|
s )
|
|
; }
|
|
printf("%c", s )
|
|
; }
|
|
printf("\n"); n
|
|
++ ; } }
|