Beecrowd 1042 Simple Sort Solution in C,Cpp

Beecrowd 1042 Simple Sort Solution

Question

Solution in C

#include<stdio.h>

int main() {
int a,b,c,temp,x,y,z;

scanf("%d%d%d",&a,&b,&c);
x=a;
y=b;
z=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\n%d\n%d\n\n",a,b,c);

printf("%d\n%d\n%d\n",x,y,z);

return 0;

}

Next problem solution: Beecrowd -1043 Triangle Solution in C & C++

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
NEW TOXIC ROCKET CYCLE DECK in Clash Royale 2023 Best Deck in Clash Royale Best Deck for Arena 8 in Clash Royale Best Hog deck for Pro players Best Clash Royale Deck