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

Re:为何会Time Limit Exceed

Posted by jackch at 2006-09-23 10:45:26 on Problem 1298
In Reply To:为何会Time Limit Exceed Posted by:2004374415 at 2006-09-19 00:54:36
//你那个判断条件都错了

#include<iostream>
#include<string.h>
#include<string>
using namespace std;
int main()
{
    char s[12],end[10];string t;
    while(gets(s)&&strcmp(s,"ENDOFINPUT"))
    {
           getline(cin,t);
           gets(end);
           string::iterator p=t.begin();
           for(int i=0;i<t.length();i++)
           {
                  if(*p>='A'&&*p<='E')  *p='V'+*p-'A';
                  else if(*p>='F'&&*p<='Z') *p-=5;
                  cout<<*p;  
                  ++p;                                   
           }   
           cout<<endl;                
                              
    }


return 0;
}
















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