1 solutions

  • 0
    @ 2025-11-5 16:19:04

    C :

    #include<stdio.h>
    void main()
    {
    	int a,b,c,temp=0;
    	scanf("%d %d %d",&a,&b,&c);
    	if(a>b) {temp=a;a=b;b=temp;}
    	if(a>c){temp=a;a=c;c=temp;}
    	if(b>c){temp=b;b=c;c=temp;}
    	printf("%d %d %d\n",a,b,c);
    }
    

    C++ :

    #include<stdio.h>
    int main()
    {
    	int a,b,c,t,m,n;
    	scanf("%d %d %d",&a,&b,&c);
    	if(a<b)
    	{
    	   t=a;
    	   a=b;
    	   b=t;
        }
    	   if(a<c)
    	   {
    	     m=a;
    	     a=c;
    	     c=m;
    	   }
    	     if(b<c)
    	     {
    	       n=b;
    	       b=c;
    	       c=n;
    	     }
    	printf("%d %d %d",c,b,a);
    	return 0;
    }
    
    • 1

    Information

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