Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Khai bao ham thu vien neu co
- #include<stdio.h>
- #include<conio.h>
- // chuong trinh chinh
- void main()
- {
- int x;
- scanf("%d",&x);
- double tien;
- if(x>=0 && x<=500)
- {
- if(x<49)// 48kwh dau tien
- {
- tien=x*600;
- printf("%.0lf\n",tien);
- }
- else
- if(x<97)// tiep the0
- {
- tien=28800+(x-48)*1004;
- printf("%.0lf\n",tien);
- }
- else
- if(x<145)// ke tiep
- {
- tien=76992+(x-96)*1214;
- printf("%.0lf\n",tien);
- }
- else // cac truong hop tu 145 kwh tro di
- {
- tien=135264+(x-144)*1594;
- printf("%.0lf\n",tien);
- }
- }
- else
- printf("0");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement