Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <time.h>
- #include <stdlib.h>
- int randint(int a, int b) {
- return (rand() % (b - a + 1)) + a;
- }
- int main(void) {
- srand(time(0));
- int a[50];
- int b[50];
- for (int i = 0; i < 50; i++) {
- a[i] = randint(0, 1000);
- }
- int b_realsize = 0;
- for (int i = 0; i < 50; i++) {
- printf("%d ", a[i]);
- if (a[i] % 5) {
- b[b_realsize++] = a[i];
- }
- }
- printf("\n %d less:\n", 50 - b_realsize);
- for (int i = 0; i < b_realsize; i++) {
- printf("%d ", b[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement