lang-bootstrap/05/main.c

16 lines
433 B
C
Raw Normal View History

2022-02-14 22:43:25 -05:00
#define _STDLIB_DEBUG
#include <stdio.h>
#include <string.h>
2022-02-13 12:51:21 -05:00
2022-02-14 16:52:33 -05:00
int main(void) {
2022-02-15 15:40:15 -05:00
int count; float quant; char units[21], item[21];
while (!feof(stdin) && !ferror(stdin)) {
count = fscanf(stdin, "%f%20s of %20s",
&quant, units, item);
fscanf(stdin,"%*[^\n]");
printf("%d %g %s %s\n", count, quant, units, item);
}
return 0;
2022-02-09 22:44:27 -05:00
}
2022-02-12 21:27:57 -05:00