1 solutions

  • 0
    @ 2025-3-3 16:33:50

    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

    Information

    ID
    10800
    Time
    1000ms
    Memory
    32MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By