java初学者编程问题[求助],
//输入整数将整数反相打印.比如输入8000.输出0008import *;
public class xt3
{
static BufferedReader keyboard=new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args)throws IOException
{
int num;
int longth;
String leng;
System.out.print("请输入一个整数:");
leng=keyboard.readLine();
longth=leng.length();
for(num=longth;num>=0;num--)
{
System.out.print(leng.substring((longth-2),longth));
longth--;
}
}
}
编译出错