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,无语了……code here:#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator