Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm> //library untuk fungsi pengurutan data
- using namespace std;
- int main(){
- int arr[6] = {7,4,2,-1,-3,5}; //array data acak yang akan diurutkan
- int temp;
- sort(arr+0, arr+6); //pengurutan data dengan fungsi dari library <algorithm>
- cout<<"Hasil pengurutan : ";
- for(int x=0;x<6;x++){
- cout<<arr[x]<<", "; //output hasil pengurutan
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment