求一道编程题,急!

来源:百度知道 编辑:UC知道 时间:2024/09/28 14:46:22
题目是:一辆重型卡车欲通过1000公里的沙漠,卡车耗油量为1公斤/公里,卡车总油量为500公斤,显然卡车装一次油是通过不了沙漠的。因此司机必须在沿途设立几个加油点,使卡车能顺利通过沙漠。试问司机如何建这些储油点?每个储油点应该储多少升油?才能使用卡车以最小耗油量的代价通过沙漠?

如果计算结果不是很大的值,也就是n和a不是很大的话,程序如下: #include <stdio.h> int main() { int a, n; int temp, i; int result = 0; printf( "please input a and n:\n" ); scanf( "%d %d", &a

这是4X4的矩阵,还有一些细节你自己写吧,比如构造函数。。。 #pragma once #include<iostream> using namespace std; class CMatrix { public: CMatrix(void); ~CMatrix(void); CMatrix operat