Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- int i = 0;
- int mas[10];
- while (i < 10){
- cin >> mas[i];
- i++;
- }
- i = 0;
- int d=0;
- while (i<10)
- {
- int j = 0;
- while (j < 9)
- {
- if (mas[j] > mas[j + 1]){
- d = mas[j];
- mas[j] = mas[j + 1];
- mas[j + 1] = d;
- }
- j++;
- }
- i++;
- }
- i = 0;
- while (i < 10){
- cout << mas[i]<<" ";
- i++;
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement