C++语言开发示例:01. 余数
modulus.cpp
#include <iostream>
int main()
{
using namespace std;
const int Lbs_per_stn = 14;
int lbs;
cout << "Enter your weight in pounds: ";
cin >> lbs;
int stone = lbs / Lbs_per_stn;
int pounds = lbs % Lbs_per_stn;
cout << "lbs"
<< " pounds are " << stone
<< " stone, " << pounds << " pound(s).\n";
} 最后更新于1年前
本文由人工编写,AI优化,转载请注明原文地址: C++语言开发示例:01. 余数
推荐阅读
评论 (0)
发表评论
昵称:加载中...
暂无评论,快来发表第一条评论吧!