当前位置:编程学习 > C/C++ >>

问题九十八:Judge Online

[plain] #include <stdio.h> 
#include <string.h> 
 
int main() 

     int i; 
     int num; 
     char string[100]; 
 
     while(gets(string)!=NULL) 
     { 
          num= strlen(string); 
 
          for(i=0; i<num; i++) 
          { 
               if(string[i]=='<') 
               { 
                   printf("<"); 
               } 
               else if(string[i]== '>') 
               { 
                   printf(">"); 
               } 
               else if(string[i]==' ') 
               { 
                   printf(" "); 
               } 
               else if(string[i]==' ') 
               { 
                    printf("    "); 
               } 
               else 
               { 
                   printf("%c", string[i]); 
               } 
          } 
 
          printf("\n"); 
     } 
     return 0; 

补充:软件开发 , C语言 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,