c++ 计算指定半径圆的面积
#include <iostream>
#define PI 3.14
using namespace std;
class Circle
{
float radius;
public:
void getRadius();
float area();
void showRadius();
}; void Circle :: getRadius()
{
cout << "Enter Radius ::: ";
cin >> radius;
} float Circle :: area()
{
float ar;
ar = PI * radius * radius;
return ar;
} void Circle :: showRadius()
{
cout << "\n Radius : " << radius;
} int main()
{
Circle c1; c1.getRadius();
c1.showRadius();
float a = c1.area();
cout << "\n Area of Circle : " << a;
return ;
}
c++ 计算指定半径圆的面积的更多相关文章
- c语言求平面上2个坐标点的直线距离、求俩坐标直线距离作为半径的圆的面积、递归、菲波那次数列、explode
#include <stdio.h> #include <math.h> #include <string.h> char explode( char * str ...
- python脚本1_给一个半径求圆的面积和周长
#给一个半径,求圆的面积和周长,圆周率3.14 r = int(input('r=')) print('area='+str(3.14*r*r)) print('circumference='+str ...
- java定义一个Circle类,包含一个double型的radius属性代表圆的半径,一个findArea()方法返回圆的面积
需求如下:(1)定义一个Circle类,包含一个double型的radius属性代表圆的半径,一个findArea()方法返回圆的面积. (2)定义一个类PassObject,在类中定义一个方法pri ...
- QtGui实现计算圆的面积
dialog.h #ifndef DIALOG_H #define DIALOG_H #include <QtWidgets/QDialog> #include <QtWidgets ...
- 【C语言】输出半径1到10的圆的面积,当面积值超过100时,停止执行本程序
#include<stdio.h> #define PI 3.142 int main() { int r; float area; ; r <= ; r++) { area = P ...
- C# - 习题06_从键盘输入半径r,求出圆的面积
时间:2017-08-24 整理:byzqy 题目:编写一个程序,定义常量 Pi = 3.14159265 , 从键盘上输入半径 r ,求出圆的面积. 代码如下: 1 using System; 2 ...
- java代码。。。圆的面积好搞人。。。不是一般的搞人。。。欢迎指点指点
package com.ll; public class Class3 { private String name; private int age; private int ...
- YTU 2723: 默认参数--求圆的面积
2723: 默认参数--求圆的面积 时间限制: 1 Sec 内存限制: 128 MB 提交: 206 解决: 150 题目描述 根据半径r求圆的面积, 如果不指定小数位数,输出结果默认保留两位小数 ...
- lqb 入门训练 圆的面积 (PS: PI的精确计算方法 atan(1.0) * 4)
入门训练 圆的面积 时间限制:1.0s 内存限制:256.0MB 问题描述 给定圆的半径r,求圆的面积. 输入格式 输入包含一个整数r,表示圆的半径. 输出格式 输出一行,包含一个实数,四 ...
随机推荐
- POI各Jar包的作用(转)
目前POI的最新发布版本是3.10_FINAL.该版本保护的jar包有: Maven artifactId Prerequisites JAR poi commons-logging, commons ...
- JS/Java/Python格式化金额
//java代码 public static void main(String[] args) { DecimalFormat myformat = new DecimalFormat(); ...
- CodeForces Roads not only in Berland(并查集)
H - Roads not only in Berland Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d ...
- SQLite随机获取一行数据
Mysql中随机获取一行数据: SELECT * FROM table ORDER BY RAND() limit 1 SQLite中随机获取一行数据: SELECT * FROM table ORD ...
- 迅雷7 纯净版v7.9.18.4724
http://soft2.xzstatic.com/2016/08/Thunder_7.9.13.4666_NoAD_VIP.exe http://www.downza.cn/soft/192064. ...
- 基于Kafka+Spark Streaming+HBase实时点击流案例
背景 Kafka实时记录从数据采集工具Flume或业务系统实时接口收集数据,并作为消息缓冲组件为上游实时计算框架提供可靠数据支撑,Spark 1.3版本后支持两种整合Kafka机制(Receiver- ...
- Java实现最基本的集中排序
排序是一个很重要的概念,现实生活中,我们需要为很多的东西排序.下面我们就介绍几种简单的排序的方法和最基本的思想. 1.冒泡排序:假设一个数组中有10个数字,从左边开始
- YTD易出现断层问题,请注意!
declare @table table( company_id int ,--公司编号 quarter_num ),--季度 disti ),--分销商 num int --数量 ) insert ...
- 72. Edit Distance(编辑距离 动态规划)
Given two words word1 and word2, find the minimum number of operations required to convert word1 to ...
- react 项目微信端 签名失败 原因
用SPA做微信h5,调用微信jssdk的页面,安卓微信上木有问题,ios微信报当前url未注册 经过调试,是ios微信版本问题导致页面跳转url未变化,导致验签失败 所以我们大致的思想就是:在ios微 ...