1 条题解

  • 0
    @ 2025-4-7 21:19:28

    C :

    #include <stdio.h>   
    #include <stdlib.h>   
      
    void contact(char *str, const char *str1, const char *str2);  
      
    int main()  
    {  
        char str[201], str1[101], str2[101];  
      
        while(scanf("%s%s",str1,str2) != EOF)  
        {  
            contact(str, str1, str2);  
            printf("%s\n",str);  
        }  
        return 0;  
    }  
    void contact(char *str, const char *str1, const char *str2)  
    {  
        int i, j;  
          
        for(i = 0; str1[i] != '\0'; i ++)  
        {  
            str[i] = str1[i];  
        }  
        for(j = 0; str2[j] != '\0'; j ++)  
        {  
            str[i + j] = str2[j];  
        }  
        str[i + j] = '\0';  
    }
    

    C++ :

    #include <stdio.h>
    #include <string.h>
    
    int main(){
    	char str1[220], str2[110];
    	while(scanf("%s%s", str1, str2) != EOF){
    		puts(strcat(str1, str2));
    	}
    
    	return 0;
    }
    
    

    Pascal :

    var st:string;p:longint;
    begin
       while not eof do
        begin
          readln(st);
          p:=pos(' ',st);
          delete(st,p,1);
          writeln(st);
        end;
    end.
    
    

    Python :

    while True:
        print ''.join(raw_input().split())
    
    
    • 1

    信息

    ID
    1096
    时间
    1000ms
    内存
    32MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者