Advertisement
jakubko329

Untitled

Aug 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.95 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int pole[10]={5,6,6,9,6,4,3,2,1,6},a,i=0,b=0,c=0,f=0,x=0,d=0,u,j=0;
  7.     char n,y,r;
  8.     printf("zadaj cislo\n");
  9.     scanf("%d",&a);
  10.     while (i<10)
  11.     {
  12.         if (a==pole[i])
  13.         {
  14.             b++;
  15.         }
  16.         i++;
  17.     }
  18.     printf("cisel %d\n",b);
  19.     i=0;
  20.    printf("chces vypisat vsetky??\n");
  21.    scanf(" %c",&r);
  22.    if (r=='y')
  23.    {
  24.         while (i<10)
  25.     {
  26.         if(pole[i]%a==0)
  27.         {
  28.             f++;
  29.         }
  30.         i++;
  31.     }
  32.     printf("delitelne %d\n",f);
  33.  
  34.    }
  35.    if (r=='n')
  36.    {
  37.        printf("kolko ich chces vypisat??\n");
  38.        scanf("%d",&u);
  39.  if(u>b)
  40.         {
  41.             printf("ty si retard!!!");
  42.             return 0;
  43.         }
  44.       while (d<u)
  45.       {
  46.           if(pole[j]%a==0)
  47.           {
  48.  
  49.               printf("%d",pole[j]);
  50.               d++;
  51.           }
  52.             j++;
  53.      }
  54.  
  55.     }
  56.  
  57.  
  58. return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement