int []num=new int[1001];
FileReader fr = new FileReader("1.txt");
BufferedReader br = new BufferedReader(fr); String str;
StringBuilder sb = new StringBuilder();
while((str=br.readLine())!=null)
{
sb.append(str);
}
String st=sb.toString();
int sum=0,mynum;
for(int i=0;i<st.length();i++)
{
num[i]=Integer.parseInt(st.substring(i,i+1));
}
乍看 很麻烦!