C#求圆的周长、面积、体积】的更多相关文章

窗体应用程序 private void button1_Click(object sender, EventArgs e) { double r; r = Convert.ToInt32(textBox1.Text); textBox2.Text = Convert.ToString(2 * r * System.Math.PI); textBox3.Text = Convert.ToString(r * r * System.Math.PI); textBox4.Text = Convert.…
面向对象编程示例:求周长和面积 #define _CRT_SECURE_NO_WARNINGS #include <iostream> using namespace std; //圆的周长 double getCircleGirth(double r) { return 2 * 3.14*r; } //源的面积 double getCircleArea(double r) { return 3.14*r*r; } //用面向对象实现 //圆类 class Circle { public: v…
#给一个半径,求圆的面积和周长,圆周率3.14 r = int(input('r=')) print('area='+str(3.14*r*r)) print('circumference='+str(2*3.14*r))…
import java.text.DecimalFormat;import java.util.Scanner; public class TheAreaOfCircle { public static void main(String[] args) { /*问题描述 给定圆的半径r,求圆的面积. 输入格式 输入包含一个整数r,表示圆的半径. 输出格式 输出一行,包含一个实数,四舍五入保留小数点后7位,表示圆的面积. 说明:在本题中,输入是一个整数,但是输出是一个实数. 对于实数输出的问题,请…
package text1; import java.util.Scanner; public class text11 { public static void main(String[] args){ Scanner sc =new Scanner(System.in); System.out.print("输入圆的半径"); int a =sc.nextInt(); System.out.print("圆的周长是:"+a*2*3.14+"圆的面积是:…
题目链接: POJ:http://poj.org/problem? id=2546 ZOJ:problemId=597" target="_blank">http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=597 Description Your task is to write a program, which, given two circles, calculates the area of the…
2723: 默认参数--求圆的面积 时间限制: 1 Sec  内存限制: 128 MB 提交: 206  解决: 150 题目描述 根据半径r求圆的面积, 如果不指定小数位数,输出结果默认保留两位小数. 部分代码已给定如下,只需要提交缺失的代码. #include <iostream> #include <iomanip> using namespace std; const double PI=3.14159; /*   补充缺少代码 */ int main() {     do…
公式: C=2πr S=πr² 代码: #include<stdio.h> int main() { float r,PI; PI = 3.14159; printf("请输入圆的半径:\n"); scanf("%f", &r); printf( * PI*r, PI*r*r); }…
题意:告诉你两个圆环,求圆环相交的面积. /* gyt Live up to every day */ #include<cstdio> #include<cmath> #include<iostream> #include<algorithm> #include<vector> #include<stack> #include<cstring> #include<queue> #include<set&…
A - Building Fence Time Limit:1000MS     Memory Limit:65535KB     64bit IO Format:%I64d & %I64u Submit Status Description Long long ago, there is a famous farmer named John. He owns a big farm and many cows. There are two kinds of cows on his farm, o…