Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int n;
- cout << "Nhap so km: ";
- cin >> n;
- int tien = 0;
- n -= 1;
- tien += 5000;
- if (n > 0){
- if (n + 1 >= 5){
- tien += 4500 * 4;
- n -= 4;
- }
- else{
- tien += 4500 * n;
- n = 0;
- }
- }
- if (n > 0){
- if (n + 5 >= 6){
- tien += 3500 * n;
- }
- }
- if (n >= 120){
- tien *= 0.9;
- }
- cout << "Tien: " << tien;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement