diff --git a/PSP2088/MathExam_v1.java b/PSP2088/MathExam_v1.java new file mode 100644 index 0000000000000000000000000000000000000000..3ed36453d91f0895b7b6f63550bee37b9fd12d7f --- /dev/null +++ b/PSP2088/MathExam_v1.java @@ -0,0 +1,46 @@ +import java.util.Scanner; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.Random; + +public class MathExam_v1 { + public static void main(String args[]) throws IOException{ + int num1; + int num2; + int flag; + int result; + int n; + File file = new File("d:/out.txt"); + DataOutputStream out = new DataOutputStream(new FileOutputStream(file)); + String sign; + Scanner Scanner = new Scanner(System.in); + Random rand = new Random(); + System.out.println("请输入想要出题的数目:"); + n = Scanner.nextInt();//输入出题道数 + for(int i=0;i