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 |
这样来处理输入行不行?int q=0; scanf("%d", &q); char ghgh; scanf("%c", &ghgh); int j=1; while(q--) { char n[10000]; char m[100][100]; int ee=0; ghgh=2; while(ghgh!='\n') { scanf("%c", &ghgh); n[ee]=ghgh; ee++; } n[ee-1]='\0'; int r=0; int h=0; for(int t=0; ; t++) { if(n[t]=='\0') { m[r][h]='\0'; break; } else { if(n[t]==' ') { m[r][h]='\0'; r++; h=0; } else { m[r][h]=n[t]; h++; } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator