Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
注意!!tle的也可能是这个原因tle了一晚上,居然是在因为输入上有个坑 6 5 ###### #A#A## # # A# #S ## ###### 空格位于"6 5 ",得丢弃 这后面有他妈的好多空格,好想给作者寄炸弹 哎,没注意评论里大佬的提醒,提供一种存入方法,好气哦 int T; char s[3000]; scanf("%d",&T); getchar(); while(T--) { init();//初始化数据 N=0; M=0; gets(s); int len=strlen(s); int ctor=0; while(s[ctor]==' ') { ++ctor; } while(s[ctor]!=' ') { M=M*10+s[ctor]-'0'; ++ctor; } while(s[ctor]==' ') { ++ctor; } while(ctor<len&&s[ctor]!=' ') { N=N*10+s[ctor]-'0'; ++ctor; } for(int i=0;i<N;++i) gets(Map[i]); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator