This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 1. 2. 创建一个名为 Circle 的类,具有成员变量 radius 和 pi(圆周率),以及成员函数 double calculateArea() ,用于计算圆的面积。
#include <iostream>
using namespace std;
class Circle
{
public:
double radius, pi = 3.1415926;
double calculateArea()
return pi * radius * radius;
}
};
int main()
return 0;