/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/
#include<stdio.h>
main()
{
int a,b,c,min,max,mid;
scanf("%d%d%d",&a,&b,&c);
min=a;
if(b<c&&b<a)
{
min=b;
}
else if(c<a&&c<b)
{
min=c;
}
mid=a;
if(b<a&&b>c||b>a&&b<c)
{
mid=b;
}
else if(c>a&&c<b||c<a&&c>b)
{
mid=c;
}
max=a;
if(b>c&&b>a)
{
max=b;
}
else if(c>a&&c>b)
{
max=c;
}
printf("%d\n%d\n%d\n\n",min,mid,max);
printf("%d\n%d\n%d\n",a,b,c);
return 0;
}
//Happy_Coding
#include<stdio.h>
main()
{
int a,b,c,min,max,mid;
scanf("%d%d%d",&a,&b,&c);
min=a;
if(b<c&&b<a)
{
min=b;
}
else if(c<a&&c<b)
{
min=c;
}
mid=a;
if(b<a&&b>c||b>a&&b<c)
{
mid=b;
}
else if(c>a&&c<b||c<a&&c>b)
{
mid=c;
}
max=a;
if(b>c&&b>a)
{
max=b;
}
else if(c>a&&c>b)
{
max=c;
}
printf("%d\n%d\n%d\n\n",min,mid,max);
printf("%d\n%d\n%d\n",a,b,c);
return 0;
}
Is that okay
ReplyDeletea,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
a,b,c= c,a,b
print(a,b,c)