Notice
Recent Posts
Recent Comments
Link
«   2025/04   »
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
Tags
more
Archives
Today
Total
관리 메뉴

임동까스

[Java] 부호 바꿔 출력하기 본문

프로그래밍기초/Java

[Java] 부호 바꿔 출력하기

임동까스 2020. 11. 27. 11:28
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int num1 = scan.nextInt();

		System.out.println(-num1);
		
	}
}

 부호 변경 출력