水年华2006-02-19 23:14:56
我怎么才可以让 main 部分 std::cout x+y的结果? 笨啊。




#include
#include
#include "calculat.h"

void main(void)
{
std::cout << "In the English system of weights, we have pounds and ounces, with 1 pound equal to 16 ounces.\n";
EnglishWeight(2,5);
std::cout << "For example:100lb+50lb\n"<
}

--------------------------- calculat.h ---------------------
class EnglishWeight
{
public:
typedef int Weight;
Weight temp;

EnglishWeight(Weight x, Weight y);
};

----------------------calculat.cpp-----------------------

#include
#include
#include "calculat.h"


EnglishWeight::EnglishWeight(int x, int y)
{

temp = x+y;
std::cout <<"here....."< }
lidongmei2006-02-19 23:46:01
回复:懂C++的大侠帮看看, 谢谢
水年华2006-02-19 23:54:01
是啊, 我这部分理论上好像清楚, 但使用上就糊涂了
北半球的孤单2006-02-20 00:03:39
方法如下。。
flywhc2006-02-20 01:31:56
题目出的有问题?原题是打印磅还是转换公制?
greenpine_12342006-02-20 20:01:22
回复:懂C++的大侠帮看看, 谢谢
greenpine_12342006-02-20 20:03:14
std::cout