diff options
Diffstat (limited to '05/main.c')
-rw-r--r-- | 05/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -3,11 +3,13 @@ #include <string.h> int main(void) { - char *s = "1.35984534e135-e12hello"; - char *end; - _Float f = _powers_of_10[-307]; - printf("%.15g\n",strtod(s, &end)); - printf("%s\n",end); + 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; } |