Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void feltolt(int*);
- void masolas(int*, int*);
- int main()
- {
- int tomb[300];
- int masodiktomb[300];
- feltolt(&tomb);
- masolas(&tomb, &masodiktomb);
- return 0;
- }
- void feltolt(int* tombpointer)
- {
- int i = 0;
- int j;
- for(j = 1000; j < 10000; j++)
- {
- if( (j & (1 << 1)) && (j & (1 << 2)) && !(j & (1 << 3)) )
- {
- tombpointer[i] = j;
- i++;
- if(i == 300)
- {
- break;
- }
- }
- }
- }
- void masolas(int* tombpointer, int* tombpointer2)
- {
- int i;
- int j = 0;
- for(i = 0; i < 300; i++)
- {
- if(tombpointer[i] % 3 == 0)
- {
- tombpointer2[j] = tombpointer[i];
- j++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement