Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int n1,n2,n3,n4,n5,n6,win1,win2,win3,win4,los1,los2,los3,los4,max,min;
- int main()
- {
- printf("Podaj liczbe 1\n");
- scanf(" %d", &n1);
- printf("Podaj liczbe 2\n");
- scanf(" %d", &n2);
- printf("Podaj liczbe 3\n");
- scanf(" %d", &n3);
- printf("Podaj liczbe 4\n");
- scanf(" %d", &n4);
- printf("Podaj liczbe 5\n");
- scanf(" %d", &n5);
- printf("Podaj liczbe 6\n");
- scanf(" %d", &n6);
- if(n1>n2)
- {
- win1=n1;
- los1=n2;
- }else{
- win1=n2;
- los1=n1;
- }
- if(n3>n4)
- {
- win2=n3;
- los2=n4;
- }else{
- win2=n4;
- los2=n3;
- }
- if(n5>n6)
- {
- win3=n5;
- los3=n6;
- }else{
- win3=n6;
- los3=n5;
- }
- if(win1>win2)
- {
- win4=win1;
- }else{
- win4=win2;
- }
- if(win3>win4)
- {
- max=win3;
- }else{
- max=win4;
- }
- if(los1<los2)
- {
- los4=los1;
- }else{
- los4=los2;
- }
- if(los3<los4)
- {
- min=los3;
- }else{
- min=los4;
- }
- printf("Najwieksza liczba to %d\n", max);
- printf("Najmniejsza liczba to %d\n", min);
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement