王婆卖瓜.cpp

来自「两个小游戏----王婆卖瓜和石头剪子布」· C++ 代码 · 共 40 行

CPP
40 行
字号
#include<iostream.h>
#include"watermelon.h"
 

void main()
{
	watermelon w1(3.0);     //
	w1.display();
	watermelon::total_disp();


	watermelon w2(5.0);      //
	w2.display();
	watermelon::total_disp();
	  
 
	watermelon w3(7.0);           //
	w3.display();
	watermelon::total_disp();


	w2.watermelon::~watermelon();   //
	watermelon::total_disp();
}


/*
The watermelon weight is: 3
Total weight is: 3
Total number is: 1
The watermelon weight is: 5
Total weight is: 8
Total number is: 2
The watermelon weight is: 7
Total weight is: 15
Total number is: 3
Total weight is: 10
Total number is: 2
Press any key to continue*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?