Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- const int size = 20;
- int tablica[size];
- for(int i = 0; i<size; i++)
- tablica[i] = size-i;
- // Subtract sort
- int none = 0;
- int obrot = 0;
- while(none == 0)
- {
- none = 1;
- for(int i = 0; i<size; i++)
- {
- if (tablica[i] > 0)
- {
- none = 0;
- tablica[i]--;
- if (tablica[i] == 0)
- cout << obrot +1 << " ";
- }
- }
- obrot++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement