areas.cpp
来自「这是我们老师留的作业」· C++ 代码 · 共 32 行
CPP
32 行
#include<iostream.h>
const double pi=3.1416;
float getR()
{
float r;
cout<<"plaese enter the rand"<<endl;
cin>>r;
return r;
}
void getinform(float &w,float &h)
{
cout<<"please enter the weight and height"<<endl;
cin>>w>>h;
}
double circle()
{ float r;
r=getR();
return pi*r*r;
}
double squre()
{
float c,d;
getinform(c,d);
return c*d;
}
void main()
{
cout<<"the circle's areas is"<<circle()<<endl;
cout<<"the squre's areas is"<<squre()<<endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?