package My;

import java.util.Scanner;
public class Example3_4 
{
	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		System.out.println("请输入x:");
		double x=scan.nextDouble(),y;		
		if(x<2)
		{
			y=2*x+1;
		}
		else
		{	if(x<8)
				y=x-3;
			else
				y=3*x-1;
		}
		System.out.println("y="+y);
	}
}