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
相关推荐
吃我一窝jio9 小时前
Python与Go线程模型深度对比
java·开发语言·python
eggwyw10 小时前
C++ union 的一种妙用法
开发语言·c++
ShineWinsu11 小时前
对于Qt:QHBoxLayout常见属性以及方法的解析
c++·qt·面试·gui·客户端·布局管理器·水平布局器
starzy199012 小时前
深入理解Scala隐式函数:自动类型转换
开发语言·后端·scala
小七在进步12 小时前
string的实现(1)
c++·笔记·visual studio
布莱克60514 小时前
Swift 循环与控制转移详解:从 for-in 到标签跳转
开发语言·ssh·swift·循环
敲上瘾15 小时前
Qt核心机制:信号与槽详解
开发语言·c++·qt·ui·qt6.3
联犀15 小时前
ai时代复杂项目的golang项目如何更好的与ai共舞:monorepo+gozero
开发语言·人工智能·golang
牢姐与蒯16 小时前
cpp算法之哈希
c++·算法·哈希算法
lcj251117 小时前
[C++] C++11
开发语言·c++·笔记