C++语言开发示例:19. 数学运算
arith.cpp
#include <iostream>
int main()
{
using namespace std;
float hats, heads;
cout.setf(ios_base::fixed, ios_base::floatfield);
cout << "Enter a number: ";
cin >> hats;
cout << "Enter another number: ";
cin >> heads;
cout << "hats = " << hats << "; heads = " << heads << endl;
cout << "hats + heads = " << hats + heads << endl;
cout << "hats - heads = " << hats - heads << endl;
cout << "hats * heads = " << hats * heads << endl;
cout << "hats / heads = " << hats / heads << endl;
} 最后更新于1年前
本文由人工编写,AI优化,转载请注明原文地址: C++语言开发示例:19. 数学运算
推荐阅读
GeoServer连接达梦数据库完整指南:空间数据配置与常见问题解决
232026-04-15
VMware Workstation 16激活码及许可证密钥获取方法
25612025-10-26
达梦数据库libgeos_c.dll加载失败解决方法:空间数据包安装指南
122026-04-14
Windows系统PyTorch安装教程:CUDA 12.1环境配置与TorchText版本兼容性指南
24442025-10-08
深信服VPN客户端下载:EasyConnect与aTrust零信任访问指南
18302025-10-17
OpenVPN安装配置完整指南:从零搭建安全VPN服务器与客户端
22482025-10-30