Commit 22c32438 authored by royus's avatar royus

fix_input

parent be1a73e6
/* io.c */
/* Last Change: 2019/06/02 (Sun) 23:53:02. */
/* Last Change: 2019/06/03 (Mon) 06:32:01. */
#include<stdio.h>
#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){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment