C++语言开发示例:04. 数学运算

2024-07-11 李腾 46 次阅读 0 次点赞

sqrt.cpp

#include <iostream>
#include <cmath>

int main()
{
    using namespace std;

    double area;
    cout << "Enter the floor area, in square feet, of your home: ";
    cin >> area;
    double side;
    side = sqrt(area);
    cout << "That's the equivalent of a square " << side
         << " feet to the side." << endl;
    cout << "How fascinating!" << endl;
}
本文由人工编写,AI优化,转载请注明原文地址: C++语言开发示例:04. 数学运算

评论 (0)

登录后发表评论

暂无评论,快来发表第一条评论吧!