1 条题解

  • 0
    @ 2023-6-11 12:15:52

    C :

    #include<stdio.h>
    #include<ctype.h>
    #include<string.h>
    int main(){
    	char a[100];
    	gets(a);
    	int i,len=strlen(a);
    	for(i=0;i<len;i++){
    		if(isspace(a[i])!=0){
    			printf("%c",a[i]);
    			
    		} 
    	}
    	for(i=0;i<len;i++){
    		if(isspace(a[i])==0){
    			printf("%c",a[i]);
    			
    		} 
    	}	
    
    
    	return 0;
    }
    

    Python :

    str1=input().strip()
    str2="".join((str1.split()))
    n=str1.count(" ")
    print(" "*n,end="")
    print(str2)
    
    
    
    • 1

    信息

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