Make 2000/anderson use fgets() not gets()

I tried to keep the format similar to the original. The only difference
is that there are more lines now.
This commit is contained in:
Cody Boone Ferguson committed 2023-03-22 10:20:35 -07:00
1 parent 601596d1be
commit 2946cf1982
2 files changed
+12 -8

No files matched your search

+3 -2
View File
@@ -12,8 +12,9 @@ Indonesia
make make
``` ```
NOTE: this entry uses `gets()` so you will likely get a warning when compiling [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) changed this entry to
and/or executing this program. use `fgets()` instead of `gets()` to make it safer. Thank you Cody!
### To run: ### To run:
+9 -6
View File
@@ -25,12 +25,15 @@ j((r[2]=0,R( ))
),r[1]-=q) && ),r[1]-=q) &&
O(g-=-q) ;} O(g-=-q) ;}
C(){( J= C(){( J=
gets (K fgets (K
[1]))&&C((B(g=K[2]),*r=!(!*r&&(*g++=0)),(*r)[r]=g-K[2],g=K[2 [1],1000,stdin))&&C((B(g=K[2]),*r=!(!*r&&(*g++=0)),(*r)[r]=g
],r[ -K[2
1]&& ],g=
O()) K[2]
);;} ,r[1
]&&O
()))
;;}
main main
(){C (){C
((l( ((l(