1 solutions

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

    C :

    #include<stdio.h>   
    
    int main(){  
    	int x;
    	scanf("%d",&x);
    	
    	int q = x / 1000;
    	int b = x / 100 % 10;
    	int s = x / 10 % 10;
    	int g = x % 10;
    	
    	int c = g * 1000 + s * 100 + b * 10 + q;
    	printf("%d",c);
    
    	return 0; 
    } 
    

    C++ :

    #include<iostream>
    using namespace std;
    int main(){
    	int i,a,b,c,d;
    	cin>>i;
    	a=i/1000;
    	b=i/100%10;
    	c=i/10%10;
    	d=i%10;
    	cout<<d*1000+c*100+b*10+a;
    }
    

    Python :

    a=int(input())
    b=a//1000;
    c=(a//100)%10;
    d=(a//10)%10;
    e=a%10;
    print(e*1000+d*100+c*10+b)
    
    • 1

    Information

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