| ||||||||||
| 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 Limit Exceeded?In Reply To:谁能告诉我为什么Output Limit Exceeded? Posted by:bootshl at 2008-05-22 20:42:58 > #include "stdio.h"
> #include "string.h"
> #include "ctype.h"
>
> int main()
> {
> int i, len;
> char kdc[30], text[200], result[200];
>
> while (1) {
> gets(kdc);
> gets(text);
>
> len = strlen(text);
>
> for (i = 0; i < len; i++) {
> if ( islower(text[i]) ) {
> result[i] = kdc[text[i] - 'a'];
> }
> else if ( isupper(text[i]) )
> result[i] = kdc[text[i] - 'A'] - 32;
> if (text[i] == ' ')
> result[i] = ' ';
> }
> result[i] = '\0';
> printf("%s\n", result);
> }
> return 0;
> }
while (1)
你来个while不多才怪
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator