C++ Primer plus--0a5 自定义带返回值的函数

cpp 复制代码
#pragma region convert.cpp
//convert.cpp -- converts stone to pounds
#if 0
#include <iostream>
 
int stonetolb(int);	//function prototype 
int main(void)
{
	using namespace std;

	int stone;
	cout << "Enter the weight in stone: ";
	cin >> stone;

	int pounds = stonetolb(stone);
	cout << stone << " stone = ";
	cout << pounds << " pounds," << endl;
	return 0;
}

int stonetolb(int sts)
{

	return 14 * sts;
}
#endif
#pragma endregion
相关推荐
南境十里·墨染春水8 小时前
C++传记(面向对象)虚析构函数 纯虚函数 抽象类 final、override关键字
开发语言·c++·笔记·算法
无巧不成书02188 小时前
30分钟入门Java:从历史到Hello World的小白指南
java·开发语言
2301_797172758 小时前
基于C++的游戏引擎开发
开发语言·c++·算法
比昨天多敲两行9 小时前
C++ 二叉搜索树
开发语言·c++·算法
Season4509 小时前
C++11之正则表达式使用指南--[正则表达式介绍]|[regex的常用函数等介绍]
c++·算法·正则表达式
问好眼9 小时前
《算法竞赛进阶指南》0x04 二分-1.最佳牛围栏
数据结构·c++·算法·二分·信息学奥赛
Birdy_x9 小时前
接口自动化项目实战(1):requests请求封装
开发语言·前端·python
海海不瞌睡(捏捏王子)10 小时前
C++ 知识点概要
开发语言·c++
桌面运维家10 小时前
VLAN配置进阶:抑制广播风暴,提升网络效率
开发语言·网络·php
一轮弯弯的明月11 小时前
Python基础-速通秘籍(下)
开发语言·笔记·python·学习