Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(){
  5. int t1,t2,t3;
  6. scanf("%d",&t1);
  7. scanf("%d",&t2);
  8. scanf("%d",&t3);
  9. if (t1 >1000 || t2 >1000 || t3 >1000 || t1<1 || t2<1 ||t3<1){
  10. return 0;}
  11.  
  12. else if( t1<t2 && t2<t3) //t1<t2<t3
  13. {
  14. printf("1\n2\n3");}
  15. else if (t2<t1 && t1<t3) //t2<t1<t3
  16. {
  17. printf("2\n1\n3");
  18. }
  19. else if (t1<t3 && t3<t2)//t1<t3<t2
  20. {
  21. printf("1\n3\n2");
  22. }
  23. else if (t3<t1 && t1<t2) //t3<t1<t2
  24. { printf("2\n3\n1");}
  25. else if (t2<t3 && t3<t1) // t2<t3<t1
  26. {
  27. printf("3\n1\n2");
  28. }
  29. else{
  30. printf("3\n2\n1"); //t3<t2<t1
  31. }
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement