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
相关推荐
小小码农Come on2 分钟前
QT中窗口位置、相对位置、绝对位置
android·开发语言·qt
diediedei4 分钟前
C++中的适配器模式变体
开发语言·c++·算法
郝学胜-神的一滴12 分钟前
Python中的Mixin继承:灵活组合功能的强大模式
开发语言·python·程序人生
叫我:松哥13 分钟前
基于python强化学习的自主迷宫求解,集成迷宫生成、智能体训练、模型评估等
开发语言·人工智能·python·机器学习·pygame
晚霞的不甘13 分钟前
Flutter for OpenHarmony 创意实战:打造一款炫酷的“太空舱”倒计时应用
开发语言·前端·flutter·正则表达式·前端框架·postman
天赐学c语言17 分钟前
1.25 - 零钱兑换 && 理解右值以及move的作用
c++·算法·leecode
WKP941818 分钟前
线程并行控制CompletableFuture
java·开发语言
北冥湖畔的燕雀19 分钟前
C++智能指针:告别内存泄漏的利器
c++·算法
CSDN_RTKLIB19 分钟前
【编码实战】源字符集设置
c++
安全二次方security²23 分钟前
CUDA C++编程指南(7.5&6)——C++语言扩展之内存栅栏函数和同步函数
c++·人工智能·nvidia·cuda·内存栅栏函数·同步函数·syncthreads