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
相关推荐
有点傻的小可爱10 分钟前
【MATLAB】新安装并口如何实现能通过PTB启用?
开发语言·windows·经验分享·matlab
符哥200816 分钟前
充电桩 WiFi 局域网配网(Android/Kotlin)流程、指令及实例说明文档
android·开发语言·kotlin
weixin_4563216416 分钟前
Java架构设计:Redis持久化方案整合实战
java·开发语言·redis
2401_8795034129 分钟前
C++与FPGA协同设计
开发语言·c++·算法
asom221 小时前
DDD(领域驱动设计) 核心概念详解
java·开发语言·数据库·spring boot
今儿敲了吗1 小时前
46| FBI树
数据结构·c++·笔记·学习·算法
oem1101 小时前
C++中的访问者模式变体
开发语言·c++·算法
SuperEugene2 小时前
JS/TS 编码规范实战:Vue 场景变量 / 函数 / 类型标注避坑|编码语法规范篇
开发语言·javascript·vue.js
暮冬-  Gentle°2 小时前
C++中的工厂方法模式
开发语言·c++·算法
乱世军军2 小时前
把 Python 3.13 降级到 3.11
开发语言·python