diff options
Diffstat (limited to 'student.c')
-rw-r--r-- | student.c | 22 |
1 files changed, 8 insertions, 14 deletions
@@ -1,24 +1,18 @@ #include <stdio.h> -#include <unistd.h> #include "user_defs.h" int main(void) { - char buffer[100]; - int num = -1, type = -1, code = -1, value = -1; - double time = -1; - int scan = -2; - char c; + char buffer[100]; fgets(buffer, 99, stdin); //mandatory to fix controller programs input stream, not needed if they use fgets and sscanf instead of scanf + + int num = -2, type = -2, code = -2, value = -2; + double time = -2; + + while (1) { - fgets(buffer, 99, stdin); - //printf("%s", buffer); - //if (buffer[0] == '1') { - // printf("first value is 1\n"); - // } - // scan = sscanf(buffer, "%d %lf %d %d %d\n", &num, &time, &type, &code, &value); - // printf("%d\n", scan); - scanf("%d %lf %d %d %d\n", &num, &time, &type, &code, &value); + scanf("%d %lf %d %d %d", &num, &time, &type, &code, &value); printf("%d, %lf, %d, %d, %d\n", num, time, type, code, value); } + return 0; } |