圆的面积

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_圆的面积的更多相关文章

  1. JAVA求圆的面积

    import java.text.DecimalFormat;import java.util.Scanner; public class TheAreaOfCircle { public stati ...

  2. java代码。。。圆的面积好搞人。。。不是一般的搞人。。。欢迎指点指点

    package com.ll; public class Class3 {     private String name;     private int age;     private int ...

  3. java定义一个Circle类,包含一个double型的radius属性代表圆的半径,一个findArea()方法返回圆的面积

    需求如下:(1)定义一个Circle类,包含一个double型的radius属性代表圆的半径,一个findArea()方法返回圆的面积. (2)定义一个类PassObject,在类中定义一个方法pri ...

  4. ACM_圆的面积

    圆的面积 Time Limit: 2000/1000ms (Java/Others) Problem Description: AB是圆O的一条直径,CD.EF是两条垂直于AB的弦,并且以CD为直径的 ...

  5. hdu5858 Hard problem(求两圆相交面积)

    题目传送门 Hard problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Other ...

  6. hdu 3264 Open-air shopping malls(圆相交面积+二分)

    Open-air shopping malls Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/ ...

  7. c语言求平面上2个坐标点的直线距离、求俩坐标直线距离作为半径的圆的面积、递归、菲波那次数列、explode

    #include <stdio.h> #include <math.h> #include <string.h> char explode( char * str ...

  8. 【BZOJ】2178: 圆的面积并

    http://www.lydsy.com/JudgeOnline/problem.php?id=2178 题意:给出n<=1000个圆,求这些圆的面积并 #include <cstdio& ...

  9. 【BZOJ】【2178】圆的面积并

    自适应辛普森积分 Orz Hzwer 辛普森真是个强大的东西……很多东西都能积= = 这题的正解看上去很鬼畜,至少我这种不会计算几何的渣渣是写不出来……(对圆的交点求图包,ans=凸包的面积+一堆弓形 ...

随机推荐

  1. SSM11-Redis---jedis的使用方法以及缓存同步

    1. Jedis 需要把jedis依赖的jar包添加到工程中.Maven工程中需要把jedis的坐标添加到依赖. 推荐添加到服务层.E3-content-Service工程中. 1.1. 连接单机版 ...

  2. 20190828 [ Night ] - 弋

    半集训可还行…… 半集训第一次模拟 考试过程 好像是上回的同套题. ××内个$\text{english}$真毒瘤 T1 什么玩意? $chinese$? 前面两句背景是个? 需要$\Theta(1) ...

  3. [待验证]使用hibernate注解忘记引入mapping导致的问题

    这个问题好像是注解主键的时候,主键没有设置为int型,我设置了个string(想直接用uuid)导致的 后来学习了一下,这个主键的注解,生成策略有很多种,换成别的,就可以使用string类型 编译报错 ...

  4. SSH 框架controller向jsp传递List jsp中使用el表达式获取

    mvc可以使用ModelAndViev传递数据选择跳转的视图 controller中的代码, 把一个模拟的表单studentListSimulate传给ModelAndView @RequestMap ...

  5. MySQL数据库起步 关于数据库的基本操作(更新中...)

    mysql的基本操作 连接指定的服务器(需要服务器开启3306端口) mysql -h ip地址 -P 端口号 -u 账号 -p 密码 删除游客模式 mysql -h ip地址 -P 端口号 -u 账 ...

  6. Linux预习

    目录 linux系统和unix系统的简介 linux系统和unix系统的简介 unix是什么:和widows一样 特点:多用户,多任务 同一时刻,多用户同时执行多项程序,互不干扰 GNU项目 就是一个 ...

  7. WordPress资料收集,以后整理

    WordPress主题开发:实现分页功能 http://www.cnblogs.com/tinyphp/p/6361901.html WordPress如何调取显示指定文章 https://www.d ...

  8. Ajax--同源策略,jsonp跨域传输原理(callback),

    什么是同源策略? 阮一峰的博客 同源策略 同源策略的解决方法: 跨域传输 img 标签的src是可以引入其他域名下的图片 script标签的src属性同理 ,也可以引入其他域名下的js文件,并执行 1 ...

  9. webpack学习之—— Plugins

    Plugins are the backbone of webpack! webpack 自身也是构建于你在 webpack 配置中用到的相同的插件系统之上! 插件目的在于解决 loader 无法实现 ...

  10. LintCode_469 等价二叉树

    题目 检查两棵二叉树是否等价.等价的意思是说,首先两棵二叉树必须拥有相同的结构,并且每个对应位置上的节点上的数都相等. 样例 1 1 / \ / \ 2 2 and 2 2 / / 4 4 就是两棵等 ...