Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

总是TLE,无语了……code here:

Posted by tt0928 at 2009-11-30 09:57:00 on Problem 1298
#include <stdio.h>
#include<stdlib.h>
#include <string.h>

/*
 * 
 */
int main(void) {

    char msg[201];
    char *table = (char*) malloc(sizeof (char) *100);
    char t[] = "VWXYZABCDEFGHIJKLMNOPQRSTU";
    int i;
    memcpy(table + 65, t, 26);
    while (1) {
        rewind(stdin);
        gets(msg);
        if (!strcmp(msg, "ENDOFINPUT"))
            return 0;
        if (!strcmp(msg, "START") || !strcmp(msg, "END"))
            continue;
        for (i = 0; msg[i] != '\0'; i++) {
            if (msg[i] >= 'A')
                putchar(table[msg[i]]);
            else
                putchar(msg[i]);
        }
        putchar('\n');
    }
    return (EXIT_SUCCESS);
}


Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator