C++开学第一次作业(5.4)
2016-05-05 22:42
363 查看
开学第一次作业(5.4)
代码传送门题目
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 shouldbedividedinto two source files (.cpp).
Hand in the source files and the head files which youcreate
主函数
#include <iostream> #include"area.h" using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { double r; cin >> r; cout << area(r) << endl; return 0; }
外部函数
#include"area.h" double area(double r) { cout << r*r*PI ; }
头文件
#include<cmath> #include<iostream> #define PI acos(-1) using namespace std; double area(double r);
相关文章推荐
- C++作业 一
- C++第一次试水写cstring类
- C++中的static关键字的总结
- c++primer plus 第六章习题
- C++课程 first work
- More Effective C++----(11)禁止异常信息传递到析构函数外
- c 语言 dll编译与使用
- C++ Circle
- c++ 内存分区
- C语言 A律压缩
- boost静态链接库和c++/clr不兼容问题:未能加载文件或程序集,不是有效的Win32应用程序。
- More Effective C++----(10)在构造函数中防止资源泄漏
- 【C++】VS2010生成的程序在安装了vc2010运行库的机器上提示“丢失MSVCR100D.dll”
- C++数组的二分法查找
- C语言中的移位操作
- leetcode 13 Roman to Integer C++
- 【C++】VS2010将写好的程序打包成安装文件发布
- 《高质量C++/C编程指南》代码规范笔记
- PAT (Advanced Level) Practise 1102 Invert a Binary Tree PAT 1102 坑点
- leetcode 92 Reverse Linked List II C++