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
相关推荐
故事不长丨几秒前
C#File文件操作全解析:从基础用法到异常处理
服务器·开发语言·visualstudio·c#·文件操作·io流·file
lowhot5 分钟前
C语言UI框架
c语言·开发语言·笔记·ui
gihigo199814 分钟前
使用MATLAB绘制3D心形图和玫瑰花图案
开发语言·matlab·3d
柠檬叶子C19 分钟前
【Python】解决 No module named ‘imp‘ 问题 | Python3 中废弃的 imp 模块
开发语言·python
源代码•宸20 分钟前
Golang基础语法(go语言结构体、go语言数组与切片、go语言条件句、go语言循环)
开发语言·经验分享·后端·算法·golang·go
我想吃烤肉肉20 分钟前
wait_until=“domcontentloaded“ 解释
开发语言·前端·javascript·爬虫·python
fy zs27 分钟前
网络基础概念
linux·网络·c++
木木木一30 分钟前
Rust学习记录--C8 常用的集合
开发语言·学习·rust
C_心欲无痕30 分钟前
js - AbortController请求中止
开发语言·javascript·ecmascript