初学java,代码通不过编译,求高手指点
import java.util.*;
public class IfDemo
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("请输入数字1——7");
int num = sc.nextInt();
if(num==1)
System.out.println(num+\t+"星期一");
else if(num==2)
System.out.println(num+\t+"星期二");
else if(num==3)
System.out.println(num+\t+"星期三");
else if(num==4)
System.out.println(num+\t+"星期四");
else if(num==5)
System.out.println(num+\t+"星期五");
else if(num==6)
System.out.println(num+\t+"星期六");
else if(num==7)
System.out.println(num+\t+"星期日");
else
System.out.println("输入不正确,请重新输入");
}
}
------解决方案--------------------每个\t 都用双引号括起来就好了