티스토리 뷰

IT/JAVA

[정보올림피아드] 198번

긍정탁 2017. 7. 10. 16:09

 

 

 

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
35
36
37
38
39
import java.util.Scanner;
 
class calc{
    int height;
    double weight;
    calc()
    {        
    }    
    static int calcHeight(int i, int j)
    {
        return ((i+j)/2)+5;
    }
    static double calcWeight(double i ,double j)
    {
        return ((i+j)/2)-4.5;
    }
}
 
public class J197 {
 
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner Sc = new Scanner(System.in);
        
        calc fa = new calc();
        calc ma = new calc();
        
        fa.height = Sc.nextInt();
        fa.weight = Sc.nextDouble();
        ma.height = Sc.nextInt();
        ma.weight = Sc.nextDouble();
    
        System.out.println("height : "+calc.calcHeight(fa.height, ma.height)+"cm");
        System.out.printf("weight :%5.1fkg" , calc.calcWeight(fa.weight, ma.weight));    
    }
}
 
 
 
cs

 

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/01   »
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