diogoAlves

IFF/Introdução à Programação/Slide/Pag 22/Ex 3

Feb 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. //IFF - Introdução à Programação
  2. //Slide - Página 22 - Exercício 3
  3. #include<stdio.h>
  4. #include<locale.h>
  5. int main(){
  6.     setlocale(LC_ALL,"Portuguese");
  7.     int x,y,z;
  8.     printf("Entre com os três valores: ");
  9.     scanf("%d %d %d",&x,&y,&z);
  10.     if ((x>y)&&(x>z)){
  11.         printf("%d",x);
  12.         if (y>z){
  13.             printf(" %d %d",y,z);
  14.         }else{
  15.             printf(" %d %d",z,y);
  16.         }
  17.     }
  18.     if ((y>x)&&(y>z)){
  19.         printf("%d",y);
  20.         if (x>z){
  21.             printf(" %d %d",x,z);
  22.         }else{
  23.             printf(" %d %d",z,x);
  24.         }
  25.     }
  26.     if ((z>x)&&(z>y)){
  27.         printf("%d",z);
  28.         if (x>y){
  29.             printf(" %d %d",x,y);
  30.         }else{
  31.             printf(" %d %d", y,x);
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment