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
相关推荐
吃吃喝喝小朋友几秒前
JavaScript文件的操作方法
开发语言·javascript·ecmascript
AI视觉网奇2 分钟前
ue5 开发 web socket server 实战2026
c++·学习·ue5
2301_797312263 分钟前
学习Java42天
java·开发语言·学习
2501_944526423 分钟前
Flutter for OpenHarmony 万能游戏库App实战 - 知识问答游戏实现
android·开发语言·javascript·python·flutter·游戏·harmonyos
chilavert3185 分钟前
技术演进中的开发沉思-325 JVM:java体系技术全貌(下)
java·开发语言·jvm
chilavert3189 分钟前
技术演进中的开发沉思-324 JVM:java技术体系全貌(上)
java·开发语言
CCPC不拿奖不改名28 分钟前
python基础面试编程题汇总+个人练习(入门+结构+函数+面向对象编程)--需要自取
开发语言·人工智能·python·学习·自然语言处理·面试·职场和发展
2501_9444241234 分钟前
Flutter for OpenHarmony游戏集合App实战之数字拼图滑动交换
android·开发语言·flutter·游戏·harmonyos
王老师青少年编程38 分钟前
2024年3月GESP真题及题解(C++八级): 接竹竿
c++·题解·真题·gesp·csp·八级·接竹竿
偷星星的贼1140 分钟前
C++中的访问者模式实战
开发语言·c++·算法