Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sed(int a[])
- {
- int b=0;
- for (int i = 0; i < 20; i++)
- {
- a[i] = rand() % 90 + 10;
- }
- //jako że się odwołujesz do a[i+1] to warunek w forze musi być do 19 bo inaczej wyjdzie poza zakres tablicy
- for (int i = 0; i < 19; i++)
- {
- if (a[i] > a[i+1])
- {
- b=a[i];
- a[i] = a[i+1];
- a[i+1]=b;
- }
- }
- }
- void kolos1()
- {
- int a[20];
- int x;
- sed(a);
- for (int i = 0; i < 20; i++)
- {
- printf("%d\n", a[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement