Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- int main(){
- int n;
- printf("\nNhap so km: ");_s("%d",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;
- }
- printf("Thanh tien: %d",tien);
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement