fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. FILE *fIn = stdin, *fOut = stdout;
  6. for (int c = getc(fIn); c >= 0;) {
  7. for (; c >= 0 && c != '.'; c = getc(fIn)) {
  8. if (putc(c, fOut) < 0) {
  9. fprintf(stderr, "Write failed!\n"); return -1;
  10. }
  11. }
  12. for (; c >= 0 && c != '\n'; c = getc(fIn)) ;
  13. }
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 4364KB
stdin
TESTD       TD      STDIN
            JEQ     TESTD       . Loop until ready
            RD      STDIN       . Get input to see how many times to loop
            STA     NUMLOOP     . Save the user's input into NUMLOOP
STLOOP      STX     LOOPCNT     . Save how many times we've loops so far
stdout
TESTD       TD      STDIN
            JEQ     TESTD       
            RD      STDIN       
            STA     NUMLOOP     
STLOOP      STX     LOOPCNT