⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex2_03.cpp

📁 一本语言类编程书籍
💻 CPP
字号:
// Exercise 2.3 Converting a length in inches to feet-and-inches.
#include <iostream>
using std::cin;
using std::cout;

int main() {
  const int inches_per_foot= 12;

  long length_inches = 0L;

  cout << "This program converts inches into feet-and-inches.\n";
  cout << "Please enter the number of inches: ";
  cin >> length_inches;

  long feet = length_inches / inches_per_foot;
  long inches = length_inches % inches_per_foot;

  cout << "\nIn " << length_inches << " inches there are "
       << feet << " feet and " << inches << " inch(es).\n";


  return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -