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 |
Re:为什么一直是output limited exceed啊!那为高手帮忙看看,谢谢了!In Reply To:为什么一直是output limited exceed啊!那为高手帮忙看看,谢谢了! Posted by:lianxi at 2005-04-22 19:27:19 > 打击的 ! > #include <iostream.h> > #include <string.h> > > int set=1; > char get[100][200]; > int i, j, k; > int count = 0; > > void fun() > { > for ( i = 1; i < count; i++ ) > { > for ( j = i - 1; j >= 0; j-- ) > { > for ( k = 0; get[i][k] != '\0' && get[j][k] != '\0'; k++) > { > if ( get[i][k] != get[j][k] ) > break; > } > if ( get[i][k] == '\0' || get[j][k] == '\0' ) > { > cout << "Set " << set++ << " is not immediately decodable." << endl; > count = 0; > return; > } > } > } > cout << "Set " << set++ << " is immediately decodable." << endl; > count = 0; > } > > void main() > { > while (true) > { > for ( i = 0; ; i++ ) > { > cin >> get[i]; > if ( strcmp(get[i],"9") == 0 ) > { > if ( i == 0 ) > return; > break; > } > count++; > } > fun(); > } > > } 将while(true)改成while(cin>>get[0]),再将下面的语句作相关修改即可。 但是,我也不知道这是为什么…… 希望来个强人来解释下。。。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator