f0203.cpp
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:1k
源码类别:

C#编程

开发平台:

Visual C++

  1. //=====================================
  2. // f0203.cpp
  3. // 拆成两个函数
  4. //=====================================
  5. #include<iostream>
  6. using namespace std;
  7. //-------------------------------------
  8. void sphere();
  9. //-------------------------------------
  10. int main(){
  11.   sphere();
  12. }//------------------------------------
  13. void sphere(){
  14.   double radius;
  15.   cout<<"Please input radius: ";
  16.   cin >>radius;
  17.   if(radius < 0) return;
  18.   cout<<"The result is "<<radius*radius*3.14*4<<"n";
  19. }//====================================
  20.