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
相关推荐
我在人间贩卖青春15 分钟前
C++之多重继承
c++·多重继承
m0_7369191031 分钟前
C++代码风格检查工具
开发语言·c++·算法
2501_9449347342 分钟前
高职大数据技术专业,CDA和Python认证优先考哪个?
大数据·开发语言·python
黎雁·泠崖1 小时前
【魔法森林冒险】5/14 Allen类(三):任务进度与状态管理
java·开发语言
2301_763472462 小时前
C++20概念(Concepts)入门指南
开发语言·c++·算法
阿猿收手吧!2 小时前
【C++】std::promise原理与实战解析
c++
TechWJ3 小时前
PyPTO编程范式深度解读:让NPU开发像写Python一样简单
开发语言·python·cann·pypto
lly2024063 小时前
C++ 文件和流
开发语言
m0_706653233 小时前
分布式系统安全通信
开发语言·c++·算法
Zach_yuan3 小时前
深入浅出 JSONCpp
linux·服务器·网络·c++