Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- 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;
- char n,y,r;
- printf("zadaj cislo\n");
- scanf("%d",&a);
- while (i<10)
- {
- if (a==pole[i])
- {
- b++;
- }
- i++;
- }
- printf("cisel %d\n",b);
- i=0;
- printf("chces vypisat vsetky??\n");
- scanf(" %c",&r);
- if (r=='y')
- {
- while (i<10)
- {
- if(pole[i]%a==0)
- {
- f++;
- }
- i++;
- }
- printf("delitelne %d\n",f);
- }
- if (r=='n')
- {
- printf("kolko ich chces vypisat??\n");
- scanf("%d",&u);
- if(u>b)
- {
- printf("ty si retard!!!");
- return 0;
- }
- while (d<u)
- {
- if(pole[j]%a==0)
- {
- printf("%d",pole[j]);
- d++;
- }
- j++;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement