Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Hoang Khac Minh Hieu
- D17CQCN11-B
- B17DCCN227
- Nhom 22
- STT 34 */
- #include <iostream>
- using namespace std;
- int main()
- {
- int a,b,c,d;
- cout <<"\nNhap cu ly di duoc trong ngay(km): ";
- cin >> a;
- cout <<"\nNhap luong xang su dung trong ngay(lit): ";
- cin >> b;
- cout <<"\nNhap gia xang cua ngay(VND/1lit): ";
- cin >> c;
- cout <<"Luong xang tieu thu trung binh tren 1km di chuyen la(lit/1km): ";
- printf("%f", (float)(b)/a);
- cout <<"\nSo tien chi cho viec trong giu xe la(VND): ";
- cin >> d;
- cout <<"\nTong so tien chi cho phuong tien di lai trong ngay la: " << b*c+d;
- fstream outfile;
- outfile.open("file.dat", ios::out);
- oufile<<"\nTong so tien chi cho phuong tien di lai trong ngay la: " << b*c+d;
- outfile.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement