summaryrefslogtreecommitdiff
path: root/05/main.c
diff options
context:
space:
mode:
Diffstat (limited to '05/main.c')
-rw-r--r--05/main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/05/main.c b/05/main.c
index 7b5789c..7ddf588 100644
--- a/05/main.c
+++ b/05/main.c
@@ -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;
}