Advertisement
uno20001

HomeWork1 (GYK) (C)

Nov 23rd, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.81 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main(void){
  4.  
  5.  
  6.  
  7.     //1. Feladat:
  8.     printf("'Sikerult' az \"elso\" feladat.\n");
  9.     //Vége
  10.  
  11.     //2. Feladat
  12.  
  13.     int a, b, c;
  14.  
  15.     scanf("%d %d %d", &a, &b, &c);
  16.  
  17.     if((b < a && a < c) || (c < a && a < b)){
  18.         printf("%d\n", a);
  19.     }else if((a < b && b < c) || (c < b && b < a)){
  20.         printf("%d\n", b);
  21.     }else if((a < c && c < b) || (b < c && c < a)){
  22.         printf("%d\n", c);
  23.     }
  24.     //vége
  25.  
  26.     //3. feladat
  27.  
  28.     int d;
  29.     scanf("%d", &d);
  30.  
  31.     if(d % 7 == 0){
  32.         printf("Oszthato 7-tel.\n");
  33.     }else{
  34.         printf("Nem oszthato 7-tel.\n");
  35.     }
  36.  
  37.  
  38.     //vége
  39.  
  40.  
  41.     //4. feladat
  42.  
  43.     int e;
  44.     scanf("%d", &e);
  45.  
  46.     printf("%d\n", e / 10);
  47.     printf("%d\n", e % 10);
  48.  
  49.  
  50.     //vége
  51.  
  52.     getchar();
  53.     return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement