Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int bug(int a[], int s,int c)
- {
- int *ptr;
- srand(time(NULL));
- int r=0;
- for (int i = 0; i < s; i++)
- {
- a[i] = rand() % 90 + 10;
- printf("%d\n", a[i]);
- }
- for (int i = 0; i < s; i++)
- {
- for (int j = 0; j < s-1; j++)
- {
- if (a[j] % 2 == 0)
- {
- c = true;
- r=a[j];
- a[j] = a[j+1];
- a[j+1] = r;
- }
- else
- {
- c = false;
- }
- }
- }
- for (int i = 0; i < s; i++)
- {
- if (a[i] % 2 == 0)
- {
- ptr = &a[i];
- }
- }
- return *ptr;
- printf("%d\n\n");
- }
- void kolos1()
- {
- int a[20];
- int s;
- bool c;
- bug(a, 20, true);
- for (int i = 0; i < 20; i++)
- {
- printf("%d\n", a[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement