T002_AdditionDouble

Posted by PeEn
2019. 5. 14. 11:00 Programing/Java
  1. T002_AdditionDouble 실수형 합계
package kr.ac.jj.java201562054;

import java.util.Scanner;

public class T002_AdditionDouble {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		
		System.out.println("첫번째 숫자는?");
		double a = scan.nextDouble();

		System.out.println("두번째 숫자는?");
		double b = scan.nextDouble();
		
		double c = a + b;
		
		System.out.println(a+"+"+b+"의 합은 "+c);
		
	}

}