Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main() {
- int ordem[] = {28, 35, 62, 998, 47, 32};
- int temp1;
- int i, j, temp2, temp4;
- for (i = 0; i < 6 - 1; i++)
- {
- for (j = i + 1; j < 6; j++)
- {
- if (ordem[i] > ordem[j])
- {
- temp1 = ordem[i];
- ordem[i] = ordem[j];
- ordem[j] = temp1;
- }
- }
- }
- for (i = 0; i < 6; i++)
- {
- std::cout << ( ordem[i]);
- std::cout << (" ");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement