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
相关推荐
小小测试开发1 小时前
安装 Python 3.10+
开发语言·人工智能·python
好评1242 小时前
【C++】智能指针全解
c++·智能指针
AAA大运重卡何师傅(专跑国道)2 小时前
【无标题】
开发语言·c#
是阿建吖!2 小时前
【Linux】信号
android·linux·c语言·c++
城北徐宫3 小时前
Linux信号深度解剖:5种产生、3张表、4次切换
linux·c++·学习
liulilittle3 小时前
论 Linux 内核态全局稳态带宽的卡尔曼估计与工程实现
linux·服务器·网络·c++·计算机网络·tcp·通信
XBodhi.3 小时前
Visual Studio C++ 语法错误: 缺少“;”(在“return”的前面)
开发语言·c++·visual studio
LSssT.3 小时前
【01】Python 机器学习
开发语言·python
l1t4 小时前
DeepSeek总结的使用实体-组件-系统和基于存在性处理进行Python编程39-40
开发语言·python
曾阿伦4 小时前
Python 搭建简易HTTP服务
开发语言·python·http