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:期待解决

Posted by hery2008 at 2007-04-15 14:59:44 on Problem 1298
In Reply To:期待解决 Posted by:hery2008 at 2007-04-15 14:06:45
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> char  change(char);
> const char E[12] = "ENDOFINPUT";
> int main()
> {
>     char p, ch, ch1, ch2, array[300], ar[12];
>     int len, i, len1;
>     for (;;)
>     { 
>         len1 = 0;
>         for (;;)
>         {
>          scanf("%c", &ch1);
>          ar[len1] = ch1;
>          len1++;
>          if (ch1 == '\n')
>              break;
>         }
>         ar[10] = '\0';
>         if (!strcmp(ar, E))
>           break;
>         p = '\0';
>         len = 0;
>         while (p!= '\n')
>             {
>                   scanf("%c", &p);
>                   ch = change(p);
>                   array[len] =  ch;
>                   len++;
>              }
>         for (;;)
>         {
>          scanf("%c", &ch2);
>          if (ch2 == '\n')
>           break; 
>         }
>         for ( i = 0; i< len; i++)
>           printf("%c", array[i]);  
>              
>        
>     }  
>     return 0; 
> }
> char change(char  t)
> {
> 
>             if (t >= 70 && t < 91)
>             {
>                 t = t - 5;
>  
>             } 
>             else if (t < 70 && t > 64 )
>              {
>                     t = t + 21;
>                     
>              }
>      
>      return t;
> }
> 为什么是runtime error

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