728x90 AdSpace

  • Latest News

    Categories

    Jumat, 06 Mei 2016

    Problem solving 419

    Kasus




    Judul : Summary of Hospital Revenue
    Algoritma

    Deklarasi:
    I, j, max, temp integer
    Deskripsi :
    Max <------- input
    For (i=1;i<=max;i++) then
    Write(‘ Masukkan data ke- ‘I’)
    for(i=1;i<=max;i++) then
    write(‘data[i]’)
    for(i=1;i<=max;i++) then
    for(j=1;j<=max;j++) then
    if(data[i]>data[j]) then
    write(‘temp=data[i])
    data[i] <------- data[j];
    data[j] <------- temp;
    C++
    #include <iostream>
    #include <cstdlib>
    #include <conio.h>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */
    int main(int argc, char *argv[]) {
    int a,b,max,temp;
    int data[15];
    cout<<"\t--------Summary of Hospital Revenue--------"<<endl;
    cout<<"Masukan banyak data : ";
    cin>>max;
    for(a=1;a<=max;a++){
    cout<<"Masukan data ke- "<<a<<"=";
    cin>>data[a];
    }
    cout<<"Data Awal : ";
    for(a=1;a<=max;a++)
    {cout<<data[a]<<" ";
    }
    for(a=1;a<=max;a++)
    {for(b=1;b<=max;b++){
    if(data[a]>data[b]){
    temp=data[a];
    data[a]=data[b];
    data[b]=temp;
    }
    }
    }
    return 0;
    }

    kunjungi blog saudaran ku untuk nomor yg lain :
    http://muhammadsutiknocronosal.blogspot.com/
    http://hadie97.blogspot.co.id/
    • Blogger Comments
    • Facebook Comments

    0 komentar:

    Posting Komentar

    Item Reviewed: Problem solving 419 Rating: 5 Reviewed By: Unknown
    Scroll to Top