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
相关推荐
泡海椒4 分钟前
告别 iText 繁杂配置:jquick-pdf 极简 PDF 生成实战(零基础上手)
java·开发语言·pdf
云泽8081 小时前
从零搭建 WSL2 + Ubuntu C/C++ 开发环境:原理、实践与底层架构解析
linux·c++·windows·ubuntu·wsl2
初願致夕霞8 小时前
C++11:类型推导与完美转发复盘笔记
c++
小猪写代码8 小时前
C++中什么是类,什么是对象
c++
君顾111 小时前
上海24小时自助健身房系统开发实战指南:从架构设计到落地部署
java·开发语言·健身房
香菜TTT11 小时前
大模型上下文协议(MCP):AI 应用的“USB-C”接口技术
开发语言·人工智能·经验分享
钓鱼的肝12 小时前
梳理(1-5)
c++·经验分享·笔记·算法·青少年编程
aramae12 小时前
模拟实现strlen()函数 (C语言)
c语言·开发语言·后端
jimy113 小时前
readelf 查看“派生类”的vtable符号
开发语言·c++
蒸蒸yyyyzwd13 小时前
cpp 选手秋招学习笔记 day37 面经学习
c++·八股