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
相关推荐
Halo_tjn2 小时前
Java 基于字符串相关知识点
java·开发语言·算法
梦想的颜色2 小时前
java 利用redis来限制用户频繁点击
java·开发语言
报错小能手2 小时前
Swift 并发 Combine响应式框架
开发语言·ios·swift
万法若空3 小时前
C++ <memory> 库全方位详解
开发语言·c++
代码中介商3 小时前
C++ 类型转换深度解析:static_cast、dynamic_cast、const_cast、reinterpret_cast
开发语言·c++
青小莫3 小时前
C++之string(OJ练习)
开发语言·c++·stl
freshman_y3 小时前
一篇介绍C语言中二级指针和二维数组的文章
c语言·开发语言
6Hzlia3 小时前
【Hot 100 刷题计划】 LeetCode 199. 二叉树的右视图 | C++ DFS 逆序遍历
c++·leetcode·深度优先
-Marks-3 小时前
【C++编程】STL简介 --- (是什么 | 版本发展历程 | 六大组件 | 重要性缺陷以及如何学习)
开发语言·c++·学习·stl·stl版本