有大佬帮忙写下这个程序嘛,谢谢

收起
import java.io.*;
public class scan {
public static void main(String[] args) throws IOException {
int x,y;
Scanner sc = new Scanner(System.in);
x = sc.nextInt();
if(x<0)
y=2*x-1;
else if(x>0)
y = 3*x-1;
else
y=-1;
System.out.println(y);
}
}
报告相同问题?