-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path243p_5번.java
More file actions
34 lines (32 loc) · 783 Bytes
/
243p_5번.java
File metadata and controls
34 lines (32 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class Circle{
private double x,y;
private int radius;
public Circle(double x,double y, int radius){
this.x=x;
this.y=y;
this.radius=radius;
}
public void show(){
System.out.println("("+x+","+y+")"+radius);
}
}
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
Circle c[]= new Circle[3];
for(int i=0;i<c.length;i++){
System.out.print("x,t,radius>>");
double x=scan.nextDouble();
double y=scan.nextDouble();
int radius=scan.nextInt();
c[i]= new Circle(x,y,radius);
}
for(int i=0;i<c.length;i++){
c[i].show();
}
}
}