package com.codegym.task.task04.task0412;
/*
Positive and negative numbers
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
String num1 = buffer.readLine();
int num = Integer.parseInt(num1);
if(num>0){
num = 2*num;
System.out.println(num);
}
if(num<0){
num+=1;
System.out.println(num);
}
if(num == 0){
System.out.println(num);
}
}
}
why BufferedReader and Scanner is not working on the code editor its throwing the eroor But its working on my eclipse ide
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
// Java Poser
12 April 2019, 02:16
Use intelliJ. It is directly connected to codegym
0