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

📄 area1.cpp

📁 C++ 这是国外计算机科学教材系列《big C++》书籍的源代码ch4
💻 CPP
字号:
#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main()
{  
   double area;
   cout << "Please enter the area of a square: ";
   cin >> area;
   if (area < 0)
   {  
      cout << "Error: Negative area.\n";
      return 1;
   }

   /* now we know that area is >= 0  */

   double length = sqrt(area);
   cout << "The side length of the square is " 
      << length << "\n";

   return 0;
}

⌨️ 快捷键说明

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