Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.20 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int n1,n2,n3,n4,n5,n6,win1,win2,win3,win4,los1,los2,los3,los4,max,min;
  4. int main()
  5. {
  6.     printf("Podaj liczbe 1\n");
  7.     scanf(" %d", &n1);
  8.     printf("Podaj liczbe 2\n");
  9.     scanf(" %d", &n2);
  10.     printf("Podaj liczbe 3\n");
  11.     scanf(" %d", &n3);
  12.     printf("Podaj liczbe 4\n");
  13.     scanf(" %d", &n4);
  14.     printf("Podaj liczbe 5\n");
  15.     scanf(" %d", &n5);
  16.     printf("Podaj liczbe 6\n");
  17.     scanf(" %d", &n6);
  18.  
  19.     if(n1>n2)
  20.     {
  21.         win1=n1;
  22.         los1=n2;
  23.     }else{
  24.     win1=n2;
  25.     los1=n1;
  26.     }
  27.     if(n3>n4)
  28.     {
  29.         win2=n3;
  30.         los2=n4;
  31.     }else{
  32.     win2=n4;
  33.     los2=n3;
  34.     }
  35.     if(n5>n6)
  36.     {
  37.         win3=n5;
  38.         los3=n6;
  39.     }else{
  40.     win3=n6;
  41.     los3=n5;
  42.     }
  43.  
  44.     if(win1>win2)
  45.     {
  46.         win4=win1;
  47.     }else{
  48.     win4=win2;
  49.     }
  50.     if(win3>win4)
  51.     {
  52.         max=win3;
  53.     }else{
  54.     max=win4;
  55.     }
  56.  
  57.     if(los1<los2)
  58.     {
  59.         los4=los1;
  60.     }else{
  61.     los4=los2;
  62.     }
  63.     if(los3<los4)
  64.     {
  65.         min=los3;
  66.     }else{
  67.     min=los4;
  68.     }
  69.     printf("Najwieksza liczba to %d\n", max);
  70.     printf("Najmniejsza liczba to %d\n", min);
  71.     system("PAUSE");
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement