Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int *podziel(void);
- main()
- {
- int i,k;
- k=podziel();
- printf("%d",k-1);
- getche();
- }
- int *podziel(void)
- {
- int a,*t=NULL,p,k=1;
- do
- {
- t=(int*)malloc(k*sizeof(int));
- printf("Podaj liczbe");
- fflush(stdin);
- scanf("%d",&a);
- if((a-111)%1000==0 && a%5==0 ||(a+111)%1000==0 && a%5==0)
- {
- *(t+k-1)=a;
- k++;
- t=(int*)realloc(t,k*sizeof(int));
- }else break;
- }while(1);
- return k;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement