1 solutions

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

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int a,b;
    	cin>>a>>b;
    	if(a>b)swap(a,b);
    	cout<<a<<" "<<b<<endl;
    	return 0;
    }
    
    

    Java :

    import java.util.Scanner;
    public class Main
    {   
    	public static void main(String[] args){
            Scanner sc = new Scanner(System.in);
            int a = sc.nextInt();
            int b = sc.nextInt();
    		if(a>b) {
    			System.out.println(b+" "+a);
    		}else {
    			System.out.println(a+" "+b);
    		}
    		
    		
    		
        }
    }
    

    Python :

    a,b=map(int,input().split())
    if a>b:
        print(b,a)
    else: 
        print(a,b)
    
    
    • 1

    Information

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