zoukankan      html  css  js  c++  java
  • 20160504课堂作业

    0、 github


    1、 题目

    Create a program that asks for the radius of a circle and prints the area of that circle, using cin and cout. The whole program should be divided into two source files(.cpp). Hand in the source files and head files which you create.


    2、 代码

    • Circle.h

       double ToCalculateCircleArea(double dCircleRadius);
      

    • Circle.cpp

       #include"Circle.h"
       #define PI 3.1415926535
       double ToCalculateCircleArea(double dCircleRadius) {
               double dCircleArea;
               dCircleArea = dCircleRadius*dCircleRadius*PI;
               return dCircleArea;
       }
      

    • Main.cpp

       #include<iostream>
       #include"Circle.h"
       using namespace std;
       
       int main() {
               double dRadius;
               cin >> dRadius;
               cout << ToCalculateCircleArea(dRadius) << endl;
               return 0;
       }
      
  • 相关阅读:
    hihocoder 1038
    hihocoder 1039
    poj 2774
    bzoj 4690&&4602
    poj 2417
    STL
    poj 1026
    poj 1064
    poj 1861(prim)
    poj 1129
  • 原文地址:https://www.cnblogs.com/HBING/p/5463683.html
Copyright © 2011-2022 走看看