Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //IFF - Introdução à Programação
- //Slide - Página 22 - Exercício 3
- #include<stdio.h>
- #include<locale.h>
- int main(){
- setlocale(LC_ALL,"Portuguese");
- int x,y,z;
- printf("Entre com os três valores: ");
- scanf("%d %d %d",&x,&y,&z);
- if ((x>y)&&(x>z)){
- printf("%d",x);
- if (y>z){
- printf(" %d %d",y,z);
- }else{
- printf(" %d %d",z,y);
- }
- }
- if ((y>x)&&(y>z)){
- printf("%d",y);
- if (x>z){
- printf(" %d %d",x,z);
- }else{
- printf(" %d %d",z,x);
- }
- }
- if ((z>x)&&(z>y)){
- printf("%d",z);
- if (x>y){
- printf(" %d %d",x,y);
- }else{
- printf(" %d %d", y,x);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment