From 22c324384f6530f71270f6f510927d913250fcff Mon Sep 17 00:00:00 2001 From: royus Date: Fri, 7 Jun 2019 15:07:08 +0900 Subject: [PATCH] fix_input --- io.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/io.c b/io.c index b158637..7df667f 100644 --- a/io.c +++ b/io.c @@ -1,5 +1,5 @@ /* io.c */ -/* Last Change: 2019/06/02 (Sun) 23:53:02. */ +/* Last Change: 2019/06/03 (Mon) 06:32:01. */ #include #include"io.h" @@ -59,9 +59,11 @@ void read_problem(void){ nowx=num=0; gets(str); for(k=0;;k++){ - if(str[k]=='*') + if(str[k]=='0') num=-1; - else if('0'<=str[k]&&str[k]<='9') + else if(str[k]=='+') + num=0; + else if('1'<=str[k]&&str[k]<='9') num=num*10+str[k]-'0'; else if(str[k]==','){ if(num<0){ -- 2.22.0