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
相关推荐
心疼你的一切11 分钟前
三菱FX5U PLC与C#通信开发指南
开发语言·单片机·c#
Tim_1022 分钟前
【C++入门】04、C++浮点型
开发语言·c++
@淡 定27 分钟前
Java内存模型(JMM)详解
java·开发语言
谈笑也风生28 分钟前
经典算法题型之复数乘法(二)
开发语言·python·算法
hkNaruto30 分钟前
【C++】记录一次C++程序编译缓慢原因分析——滥用stdafx.h公共头文件
开发语言·c++
先知后行。1 小时前
python的类
开发语言·python
派大鑫wink1 小时前
【Day12】String 类详解:不可变性、常用方法与字符串拼接优化
java·开发语言
柏木乃一1 小时前
进程(6)进程切换,Linux中的进程组织,Linux进程调度算法
linux·服务器·c++·算法·架构·操作系统
JIngJaneIL1 小时前
基于springboot + vue健康管理系统(源码+数据库+文档)
java·开发语言·数据库·vue.js·spring boot·后端
dyxal1 小时前
Python包导入终极指南:子文件如何成功调用父目录模块
开发语言·python