Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.javarush.task.task04.task0412;
- /*
- Положительное и отрицательное число
- */
- import java.io.*;
- public class Solution {
- public static void main(String[] args) throws Exception {
- //напишите тут ваш код
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- String A = reader.readLine();
- int B = Integer.parseInt(A);
- if (B > 0) {
- System.out.println(B*2);
- }
- else if (B < 0) {
- System.out.println(B+1);
- }
- else if (B == 0) {
- System.out.println(B);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement