Learning path · Programming Foundations with Python
← Back to lesson · Functions부호 바꾸어 출력하기
Unrated
한국어
Language
Contribute a translation- Time limit
- 1000 ms
- Memory limit
- 256 MB
- Submissions
- 6
- Correct
- 5
- Solved by
- 5
- AC rate
- 83.333%
Statement
정숫값 하나를 전달받아 부호를 반대로 바꾼 값을 출력하는 함수 g()를 설계하시오.
Input
첫째 줄에 정수 $n$이 주어진다. ($-1\,000 \le n \le 1\,000$)
Output
$n$의 부호를 바꾼 값을 한 줄에 출력한다. $n$이 0이면 0을 출력한다.
Examples
Sample input 1
7
Sample output 1
-7
Sample input 2
-13
Sample output 2
13
Tags
No tags yet