Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define SIZE 10
- using namespace std;
- int main(){
- int arr[SIZE];
- for(int inputCnt = 0; inputCnt < SIZE; inputCnt++){
- cout << "[" << inputCnt << "]: ";
- cin >> arr[inputCnt];
- }
- for(int a = 0; a < SIZE; a++){
- for(int b = 0; b < SIZE-a; b++){
- if (arr[b] > arr[b+1]){
- int temp = arr[b];
- arr[b] = arr[b+1];
- arr[b+1] = temp;
- }
- }
- }
- for (int cnt = 0; cnt < SIZE; cnt++){
- cout << arr[cnt] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement