1 #include<iostream> 2 #define PI 3.14159265358979 3 using namespace std; 4 5 float r; 6 float s; 7 8 void Circle() 9 { 10 cout<<"请输入半径"<<endl; 11 cin>>r; 12 s=PI*r*r; 13 } 14 15 void main() 16 { 17 Circle(); 18 cout<<"圆的面积为:"<<s<<endl; 19 }
我觉得这代码太简单了,再写个新的吧.