Bu Tutuk - 14-05-2018
Last active
June 9, 2018 08:05
-
-
Save aldhinya/6a9ab44c77df5d98c2f9525d20bc91dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int data[50]; | |
int n; | |
int t; | |
cout << "> Input Batas = "; | |
cin >> n; | |
cout << endl; | |
for (int i=0; i<n; i++) | |
{ | |
cout << "Masukkan Data ke "<<i+1<< " = "; | |
cin >> data[i]; | |
} | |
cout << "\n> Setelah diurutkan = "; | |
for (int i=0; i<n; i++) | |
{ | |
for (int j=1+i; j<=n; j++) | |
{ | |
if(data[i] > data[j]) | |
{ | |
t=data[i]; | |
data[i]=data[j]; | |
data[j]=t; | |
} | |
} | |
cout << data[i] << " "; | |
} | |
cout << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tutuk ndi ? :v