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
相关推荐
阿里加多2 小时前
第 4 章:Go 线程模型——GMP 深度解析
java·开发语言·后端·golang
likerhood2 小时前
java中`==`和`.equals()`区别
java·开发语言·python
zs宝来了3 小时前
AQS详解
java·开发语言·jvm
telllong4 小时前
Python异步编程从入门到不懵:asyncio实战踩坑7连发
开发语言·python
And_Ii4 小时前
LCR 168. 丑数
c++
CoderMeijun5 小时前
C++ 时间处理与格式化输出:从 Linux 时间函数到 Timestamp 封装
c++·printf·stringstream·时间处理·clock_gettime
wjs20245 小时前
JavaScript 条件语句
开发语言
阿里加多6 小时前
第 1 章:Go 并发编程概述
java·开发语言·数据库·spring·golang
2301_792674866 小时前
java学习day29(juc)
java·开发语言·学习
周末也要写八哥6 小时前
MATLAB R2025a超详细下载与安装教程(附安装包)
开发语言·matlab