求检查错误,现在能通过编译,但是算出来的结果不对
import java.io.*;
public class wang
{
public static void main(String[] args) throws IOException
{
int n;
String str;
InputStreamReader in;
in=new InputStreamReader(System.in);
BufferedReader buf;
buf=new BufferedReader(in);
System.out.println("请输入一个实数:");
str=buf.readLine();
n=Integer.parseInt(str);
int j=1,Sum=1,i;
for(i=1;i<=n;i++)
{
j=2*j;
Sum=Sum+j;
}
System.out.print(Sum);BufferedReader
}
}