1

EEEEEEEEEEEEEEEEEEEE

import java.text.Format;
import java.util.Scanner;


class circle{
	int r;
	circle (int r){
		this.r=r;
	}
	public double area(){
		return Math.PI*r*r;
	}
}
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int r,n,i;
		Scanner sc = new Scanner(System.in);
		n=sc.nextInt();
		for(i=0;i<n;i++){
		r = sc.nextInt();
		circle c1 = new circle(r);
		System.out.print("Case "+(i+1)+": ");
		System.out.println(String.format("%.2f",c1.area()));
		}
	}

}


FFFFFFF

import java.util.Scanner;  
  
public class Main {  
    public static void main(String[] args) {  
        Scanner in = new Scanner(System.in);  
        while(in.hasNext()){  
            String a = in.nextLine();  
            Color color = new Color(a);  
            color.show();  
        }  
        in.close();  
    }  
}  
class Color{  
    String a;  
    public Color(String a){  
        this.a = a;  
    }  
    public void show(){  
        if(a.compareTo("red")==0)  
            System.out.println("Rose are red.");  
        else if(a.compareTo("orange")==0)  
            System.out.println("Poppies are orange.");  
        else if(a.compareTo("yellow")==0)  
            System.out.println("Sunflower are yellow.");  
        else if(a.compareTo("green")==0)  
            System.out.println("Grass are green.");  
        else if(a.compareTo("blue")==0)  
            System.out.println("Bluebells are blue.");  
        else if(a.compareTo("violet")==0)  
            System.out.println("Violets are violet.");  
        else    
            System.out.println("I don't know about the color " + a + ".");  
    }  
}  


G
import java.text.Format;
import java.util.Scanner;


class zheng{
int a;
zheng (int a){
this.a=a;
}
int area(){
return a*a;
}
}
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a;
Scanner sc =new Scanner(System.in);
while(sc.hasNext()){
a=sc.nextInt();
zheng x = new zheng(a);
System.out.println(x.area());
}
}


}

HHHHHHHHH

import java.text.Format;
import java.util.Scanner;


class clock{
String str;
clock(String str){
this.str =str;
}
int x,y,z,d;

void set1(){
x = (str.charAt(0)-'0')*10+(str.charAt(1)-'0');  
        z = (str.charAt(1)-'0')*10+(str.charAt(0)-'0');  
        y = (str.charAt(3)-'0')*10+(str.charAt(4)-'0');  
       /* System.out.println(x);
        System.out.println(y);
        System.out.println(z);*/
}
void time(){
if(!((x>=6&&x<=9)||(x>=16&&x<=19))){  
if(y<z){
System.out.printf("%02d:%02d",x,z);
System.out.println();  
}
else{
if(x==23){
System.out.println("00:00");
}
else {
d = x + 1;  
                    if(d >= 16 && d <= 19){  
                        System.out.println("20:02");  
                         
                    }  
                    else if(d >= 6 && d <= 9){  
                        System.out.println("10:01");  
                   
                    }  
                    else System.out.printf("%02d:%02d",d,(d%10)*10+(d/10));  
                      System.out.println();  
}
}
}
else if(x>=16&&x<=19){
System.out.println("20:02");
}
else {
System.out.println("10:01");
}

}
}
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
String str;
Scanner sc =new Scanner(System.in);
while(sc.hasNext()){
str=sc.nextLine();
clock c1=new clock(str);
c1.set1();
c1.time();
}
}


}

IIIIII
import java.util.Arrays;
import java.util.Scanner;
class Point{
 double x;
 double y;
 public Point(double x,double y)
 {
  this.x=x;
  this.y=y;
 }
 
 public double dist(Point p)
 {
  return Math.sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
 }
 
}
class Circle
{
 double r;
 public Circle(double r) {
  this.r = r;
 }
 public double length()
 {
  return 2*Math.PI*r;
 }
 
 }


public  class Main{
 public static void main(String[] args) {
  Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();
  double r=sc.nextDouble();
  
  Point[] ps=new Point[n];
  for(int i=0;i<n;i++)
  {
   ps[i]=new Point(sc.nextDouble(),sc.nextDouble());
  }
  
  double dist=0.0;
  //PP
  int j;
  for(j=0;j<n-1;j++)
  {
   dist+=ps[j].dist(ps[j+1]);
  }
  dist+=ps[j].dist(ps[0]);
  //CL
  Circle c=new Circle(r);
  dist+=c.length();
  
  //SYSO
  System.out.printf("%.2f",dist);
  
 }
  
}



JJJJJJJJJJ
import java.util.Scanner;
class FS {
 int a; // 分子
 int b; // 分母
 public FS(int a, int b) {
  this.a = a;
  this.b = b;
 }
 public FS add(FS fs) {
  int c = a * fs.b + b * fs.a;
  int d = b * fs.b;
  return new FS(c, d);
 }
 public FS sub(FS fs) {
  int c = a * fs.b - b * fs.a;
  int d = b * fs.b;
  return new FS(c, d);
 }
 public int gys(int m, int n) // 最大公约数
 {
  int r = m;
  while (r != 0) {
   m = n;
   n = r;
   r = m % n;
  }
  return n;
 }
 public String toString() // 输出 a/b的最简,符合阅读习惯
 {
  String str = "";
  if (a % b == 0) {
   str += a / b;
  } else {
   if (a * b < 0) {
    str += "-";
   }
   // |a|/|b|
   int a1 = Math.abs(a);
   int b1 = Math.abs(b);
   int s = gys(a1, b1);
   a1 = a1 / s;
   b1 = b1 / s;
   str = str + a1 + "/" + b1;
  }
  return str;
 }
}
public class Main {
 public static void main(String[] args) {
  // 输入
  Scanner sc = new Scanner(System.in);
  while (sc.hasNext()) {
   String str = sc.nextLine(); // 1/8+3/8
   // 操作与调用
   int a = str.charAt(0) - '0';
   int b = str.charAt(2) - '0';
   int c = str.charAt(4) - '0';
   int d = str.charAt(6) - '0';
   char op = str.charAt(3);
   FS fs1 = new FS(a, b);
   FS fs2 = new FS(c, d);
   // 输出
   if (op == '+') {
    System.out.println(fs1.add(fs2));
   } else {
    System.out.println(fs1.sub(fs2));
   }
  }
 }
}
 


KKKKKKKKKKKK
import java.text.Format;
import java.util.Scanner;


class clock{
int f[]=new int [60];
int n,i;
clock(int n){
this.n=n;
}
void digui(){
f[0]=0;
f[1]=1;
for(i=2;i<n;i++){
f[i]= 4*f[i-1]-5*f[i-2];
}
System.out.println(f[n-1]);
}
}
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub

Scanner sc =new Scanner(System.in);
while(sc.hasNext()){
int x,i;
x=sc.nextInt();
for(i=0;i<x;i++){
int n=sc.nextInt();
clock c1 = new clock(n);
c1.digui();
}
}
}


}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值