Java练习 SDUT-1588_圆的面积
圆的面积
Time Limit: 1000 ms Memory Limit: 32768 KiB
Problem Description
Give you the radius of a circle,caculate its area,PI=3.141592653。
Input
The first line of the input is a positive integer N,then follows N lines,each line is a real number represent the radius of the circle.
Output
Output contains N lines,for each line of the input you should output one line, Case K: S,and K(count from 1)represents the number of the circle and S is the area.Keep two digits after the decimal point.
Sample Input
3
1
2
3
Sample Output
Case 1: 3.14
Case 2: 12.57
Case 3: 28.27
注意圆周率的值。
import java.util.*;
public class Main
{
static public void main(String[] args)
{
Scanner cin = new Scanner(System.in);
int t,n;
node a = new node();
t = 0;
n = cin.nextInt();
while(++t<=n)
{
a.a = cin.nextDouble();
System.out.printf("Case %d: ",t);
System.out.printf("%.2f\n",a.GetSize());
}
cin.close();
}
}
class node
{
public double PI = 3.141592653;
double a;
double GetSize()
{
return a*a*PI;
}
}
Java练习 SDUT-1588_圆的面积的更多相关文章
- JAVA求圆的面积
import java.text.DecimalFormat;import java.util.Scanner; public class TheAreaOfCircle { public stati ...
- java代码。。。圆的面积好搞人。。。不是一般的搞人。。。欢迎指点指点
package com.ll; public class Class3 { private String name; private int age; private int ...
- java定义一个Circle类,包含一个double型的radius属性代表圆的半径,一个findArea()方法返回圆的面积
需求如下:(1)定义一个Circle类,包含一个double型的radius属性代表圆的半径,一个findArea()方法返回圆的面积. (2)定义一个类PassObject,在类中定义一个方法pri ...
- ACM_圆的面积
圆的面积 Time Limit: 2000/1000ms (Java/Others) Problem Description: AB是圆O的一条直径,CD.EF是两条垂直于AB的弦,并且以CD为直径的 ...
- hdu5858 Hard problem(求两圆相交面积)
题目传送门 Hard problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Other ...
- hdu 3264 Open-air shopping malls(圆相交面积+二分)
Open-air shopping malls Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/ ...
- c语言求平面上2个坐标点的直线距离、求俩坐标直线距离作为半径的圆的面积、递归、菲波那次数列、explode
#include <stdio.h> #include <math.h> #include <string.h> char explode( char * str ...
- 【BZOJ】2178: 圆的面积并
http://www.lydsy.com/JudgeOnline/problem.php?id=2178 题意:给出n<=1000个圆,求这些圆的面积并 #include <cstdio& ...
- 【BZOJ】【2178】圆的面积并
自适应辛普森积分 Orz Hzwer 辛普森真是个强大的东西……很多东西都能积= = 这题的正解看上去很鬼畜,至少我这种不会计算几何的渣渣是写不出来……(对圆的交点求图包,ans=凸包的面积+一堆弓形 ...
随机推荐
- 【html、CSS、javascript-11】jquery-事件使用方法总结
jquery提供了许多的事件处理函数,下面对其总结一下,梳理一下知识点,便于记忆和使用. 一.鼠标事件 1. click():鼠标单击事件 $div = $("div") $div ...
- spring cloud深入学习(四)-----eureka源码解析、ribbon解析、声明式调用feign
基本概念 1.Registe 一一服务注册当eureka Client向Eureka Server注册时,Eureka Client提供自身的元数据,比如IP地址.端口.运行状况指标的Uri.主页地址 ...
- 【solr】Solr5.5.4单机部署
Solr5.5.4单机部署 Solr5和Solr4有很大区别,最为明显的就是Solr5已经可以独立部署,从Solr5开始,Solr已经不再以war包形式部署,Solr已经成为了一个独立的java服务端 ...
- windows 环境下搭建docker私有仓库
windows 环境下搭建docker私有仓库 1.在公用仓库中pull仓库镜像 docker pull regitry 2.启动仓库镜像 //-d意思是后台运行,-p是做端口映射,这里是将本地的50 ...
- js顺序加载与并行加载
前端优化过程中常提到js的加载方式,下面说下几种常用的加载方式: 1:head标签内插入<script>标签 <script type="text/javaScript&q ...
- Node.js调试技巧
1. console.log 跟前端调试相同,通过一步步打印相关变量进行代码调试 2. 使用Node.js内置的调试器 通过node debug xxx.js来进行调试: [root@~/wade/n ...
- 【CS Round #44 (Div. 2 only) B】Square Cover
[链接]点击打开链接 [题意] 给你一个n*m的矩形,让你在其中圈出若干个子正方形,使得这些子正方形里面的所有数字都是一样的. 且一样的数字,都是在同一个正方形里面.问你有没有方案. [题解] 相同的 ...
- laravel-admin 安装(总结)
https://www.jianshu.com/p/844b05e4c45a laravel-admin 是一个可以快速帮你构建后台管理的工具,它提供的页面组件和表单元素等功能,能帮助你使用很少的代码 ...
- oracle触发器级联删除
create or replace trigger delete_trigger1 after delete on contracting_party for each row begin if de ...
- go 文件操作 io
package main import ( "fmt" "os" ) func main() { //打开文件 //概念说明: file 的叫法 //1. fi ...