Advertisement
botvn

TinhTienTaxi

Apr 7th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int km;
  7.     cout << "nhap km: ";
  8.     cin >> km;
  9.  
  10.     if (km == 1)
  11.     {
  12.         cout << "5000";
  13.     }
  14.     else if (km <= 30)
  15.     {
  16.         cout << (km - 1) * 4000 + 5000;
  17.     }
  18.     else
  19.     {
  20.         cout << (km - 30) * 116000 + 5000;
  21.     }
  22.     system("pause");
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement