Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main (){
- double arr[100];
- int jumlah = 0;
- int posisi;
- while (1)
- {
- if (cin.get() == '\n')break;
- else{
- cin >> arr[jumlah];
- jumlah++;
- }
- }
- cout <<jumlah << endl;
- //kuartil 1
- posisi = (jumlah+2)/4;
- cout << "Kuartal 1 : " << arr[posisi-1] << endl;
- //kuartil 2
- posisi = (jumlah/2);
- cout << "Kuartal 2 : " << (arr[posisi] + arr[posisi-1])/2 << endl ;
- //kuartil 3
- posisi = (3*jumlah+2)/4;
- cout << "Kuartal 3 : " << arr[posisi-1] ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement