1 solutions

  • 0
    @ 2025-3-3 16:28:34

    C :

    #include<stdio.h>
    int main()
    {
        int m,n,t,s;
        scanf("%d",&m);
        n=m/10;
        t=m%10;
        s=t*10+n;
        if(s>m)
            printf("%d",s);
        else
            printf("%d",m);
        return 0;
    }
    
    

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    
    int main(){
        int n;
        cin>>n;
        int x = n % 10 * 10 + n / 10;
        if(n > x){
        	cout<<n;
    	}else{
    		cout<<x;
    	}
    }
     
    
    

    Java :

    import java.util.Scanner;
    
    public class Main {
    
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		Scanner sc = new Scanner(System.in);
    		int a = sc.nextInt();
    		int g = a % 10;
    		int s = a / 10;
    		int b = g * 10 + s;
    		if(a > b){
    			System.out.println(a);
    		}if(a < b){
    			System.out.println(b);
    		}
    	}
    
    }
    
    

    Python :

    n = int(input())
    s = n // 10 % 10
    g = n // 1 % 10
    b = g * 10 + s
    if b > n:
        print(b)
    else:
        print(n)
    
    • 1

    Information

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