Advertisement
rizky_herucakra

how about this ?

May 10th, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <string>
  4. #include <vector>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     int n;
  10.  
  11.     cout << "Masukan Jumlah Wahana : "; cin >> n;
  12.  
  13.     vector<string> wahana;
  14.     vector<int> tiket;
  15.  
  16.     string temp;
  17.     int tmp2;
  18.     for (int i = 0; i<n; ++i)
  19.     {
  20.         cout << "Nama Wahana " << i << " : " <<flush; cin >> temp;
  21.         wahana.push_back(temp);
  22.         cout << "Jumlah tiket Wahana " << i << " : " <<flush; cin >> tmp2;
  23.         tiket.push_back(tmp2);
  24.     }
  25.  
  26.  
  27.     return 0;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement