实现一个命令行程序,要求:编程
以下所示学习
题目1: 3 + 4 = <输入7> 正确! 题目2: 5 ÷ 8 = <输入5/6> 错误,正确答案为:5/8 题目3: 2/3 - 1/5 = <输入7/15> 正确! 题目4: 1/6 * 3/7 = <输入3/42> 正确! 题目5: 10 - 5 * 4 = <输入20> 错误,正确答案为:-20 题目6: (1/3 + 1/2) * 11/20 = <输入55/120> 错误,正确答案为:11/24 完成6道题目,正确率为50%
int amount = Integer.parseInt(args[0]); int level = Integer.parseInt(args[1]); 利用Integer.parseInt()这一命令,将字符串的数据类型转换成整形的数字。 public void inFile(String fileName) throws IOException { String issue = ""; BufferedWriter bf = new BufferedWriter(new FileWriter(fileName)); for (String i : list) { bf.write(i); bf.newLine(); } bf.close(); }