import java.util.Scanner;
class Xiti
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);//请问这句咋理解?这创建个对象,括号里咋还有东西?
System.out.println;
int score = sc.nextInt();
int y = intA(score);
System.out.println("y="+y);
}
public static int intA(int x){
int y = 0;
if(x>0){
y = x + 3;
}
else if(x==0){
y = 0;
}
else{
y = x*x-1;
}
return y;
}
} |
|