package cn.mashen.homework4;
import java.io.FileWriter;
import java.io.IOException;
import org.omg.Messaging.SyncScopeHelper;
public class zai01 {
public static void main(String[] args) throws IOException {
FileWriter file = new FileWriter("F:/test/homework01.txt");
//int a=Integer.parseInt(method());
String a = method();
file.write(a);
file.close();
}
public static String method(){
String A = "";
for (int a=1 ; a<10 ; a+=2 ){
for (int b = 1 ; b <= a ; b++){
A = A.concat(a+"*"+b+"="+(a*b)+"\t");
}
A = A.concat("\r\n");
}
//System.out.println(A);
return A;
}
}
package cn.mashen.homework4;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class zai02 {
public static void main(String[] args) throws IOException {
FileReader readers = new FileReader("F:/test/homework01.txt");
// int a = readers.read();
// System.out.print((char)a);
//
// a = readers.read();
// System.out.print((char)a);
//
int a = readers.read();
while (a!= -1){
System.out.print((char) a);
a = readers.read();
}
}
}