C++??????ó??????
???????????? ???????[ 2015/7/16 11:11:30 ] ??????????????????? ????????
?????????????????????
1 #include<iostream>
2
3 using namespace std;
4
5 class Circle
6 {
7 public:
8 double pi = 3.1415926;
9 double r;
10 double area = pi*r*r;
11
12 double setArea()
13 {
14 return area = pi*r*r;
15 }
16 };
17
18 int main()
19 {
20 Circle c1;
21 cout << "???????:" << endl;
22 cin >> c1.r;
23
24 cout << c1.area << endl;
25 cout << c1.setArea() << endl;
26
27 system("pause");
28 return 0;
29 }
???????н??:
???????????:10
????2.69149e+124
????314.159
???????????????. . .
?????????н???????????????area?ó???????????????????????????????????Circle????????c1?? ????????????????????? pi*r*r???????????????????????????????area??????????????.
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11