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
相关推荐
星空椰16 分钟前
Python 面向对象高级:继承与类定义详解
开发语言·python
wunaiqiezixin24 分钟前
如何在C++中创建和管理线程
c++
白露与泡影33 分钟前
2026大厂Java面试题大全!牛客网最新版
java·开发语言
凯瑟琳.奥古斯特34 分钟前
高阶子查询题目精炼
开发语言·数据库·python·职场和发展·数据库开发
雪度娃娃1 小时前
转向现代C++——在意为改写的函数添加 override
开发语言·c++
王老师青少年编程1 小时前
csp信奥赛C++高频考点专项训练之前缀和&差分 --【一维差分】:[NOIP 2018 提高组] 铺设道路
c++·前缀和·差分·csp·高频考点·信奥赛·铺设道路
星马梦缘1 小时前
aaaaa
数据结构·c++·算法
喵星人工作室2 小时前
C++火影忍者1.1.2
开发语言·c++
basketball6162 小时前
C++ 中的 ptrdiff_t 详解
开发语言·c++
wunaiqiezixin3 小时前
互斥锁与自旋锁的区别
c++