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
相关推荐
秋田君28 分钟前
Qt_QVariant
开发语言·qt
江华森31 分钟前
Python 实现高德地图找房(三):地图可视化与高德 JS API
开发语言·javascript·python
weixin_4713830336 分钟前
args,...args与Parameters<T>
开发语言·前端
来一碗刘肉面39 分钟前
C++中的引用语法
c++·算法
杜子不疼.1 小时前
【Qt初识】工程起步:项目创建、代码解读与对象树
数据库·c++·qt
ctrl_v助手1 小时前
C#表达题笔记
开发语言·c#
汉克老师2 小时前
GESP2026年6月认证C++八级( 第二部分判断题(1-10))精讲
c++·归并排序·dijkstra·二分·互斥·gesp8级·可重复组合
2zcode2 小时前
基于MATLAB卷积神经网络的口罩佩戴检测系统
开发语言·matlab·cnn
米饭不加菜2 小时前
使用万用表判断三极管(BJT)好坏
java·开发语言
绝世唐门三哥3 小时前
vue3中页面返回时刷新首页的处理方案
开发语言·前端·javascript