Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- zadaca 2.
- input:
- 7
- 2 42 4 16 96 101 202
- output:
- 42 16 96 202
- */
- #include <stdio.h>
- #include <stdlib.h>
- int func(int a){
- int i, x, x1, counter=0;
- for(i=0; i<a; i++){
- x1 = x;
- scanf("%d", &x);
- if(i==0){
- continue;
- }
- if(x%x1==0){
- printf("%d ", x);
- counter++;
- }
- }
- return counter;
- }
- int main()
- {
- int i, br1, br2, n, coutie=0;
- scanf("%d", &n);
- printf("\n%d",func(n));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment