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

📄 prog4_02.cpp

📁 c++最经典的入门书籍
💻 CPP
字号:
// Program 4.2 Using an if statement
#include <iostream>
using std::cin;
using std::cout;
using std::endl;

int main() {
  cout << "Enter an integer between 50 and 100: ";

  int value = 0;
  cin >> value;

  if(value < 50)
    cout << "The value is invalid - it is less than 50." << endl;

  if(value > 100)
    cout << "The value is invalid - it is greater than 100." << endl;

  cout << "You entered " << value << endl;
  return 0;
}

⌨️ 快捷键说明

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