summaryrefslogtreecommitdiff
path: root/student.c
diff options
context:
space:
mode:
Diffstat (limited to 'student.c')
-rw-r--r--student.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/student.c b/student.c
new file mode 100644
index 0000000..908daa9
--- /dev/null
+++ b/student.c
@@ -0,0 +1,24 @@
+#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;
+ 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);
+ printf("%d, %lf, %d, %d, %d\n", num, time, type, code, value);
+ }
+ return 0;
+}