当前位置: 首页 > news >正文

网页制作三剑客是指/seo网络排名优化哪家好

网页制作三剑客是指,seo网络排名优化哪家好,php网站制作实例教程,银行管理系统网站建设今天又来一次课堂测试,这次测试让我对文件流的了解又加深了好多好多,这次就像升华一般,虽然和其他人比还有区别,但与以前的我大不一样了。 1 import java.io.*;2 import java.util.*;3 4 import org.omg.Messaging.SyncScopeHelpe…

今天又来一次课堂测试,这次测试让我对文件流的了解又加深了好多好多,这次就像升华一般,虽然和其他人比还有区别,但与以前的我大不一样了。

  1 import java.io.*;
  2 import java.util.*;
  3 
  4 import org.omg.Messaging.SyncScopeHelper;
  5 public class Creat {
  6     int wrongNum=0;
  7     static File file=new File("answ.txt");
  8     static FileWriter fw=null;
  9     static FileReader fr = null;
 10     int[] answ = new int[31];
 11     String[] timu = new String[31];
 12 //题目创建并存储
 13     public void creat() throws IOException {
 14 
 15         for (int i = 0; i < 3; i++) {
 16 
 17             int choice = (int) (Math.random() * 5);
 18             switch (choice) {
 19             // +
 20             case 0:
 21                 doAdd(i + 1);
 22                 break;
 23             // -
 24             case 1:
 25                 doReduce(i + 1);
 26                 break;
 27             // *
 28             case 2:
 29                 doMul(i + 1);
 30                 break;
 31             // /
 32             case 3:
 33                 doDivide(i + 1);
 34                 break;
 35             }
 36         }
 37     }
 38 //    /
 39     private void doDivide(int i) throws IOException {
 40         // TODO Auto-generated method stub
 41         System.out.print("第" + i + "次为:");
 42 
 43         int one = (int) (Math.random() * 10);
 44         int two = (int) (Math.random() * 10);
 45         while (two == 0) {
 46             two = (int) (Math.random() * 10);
 47         }
 48         answ[i] = one / two;
 49         write(one,two,"/");
 50         System.out.println("答案为" + answ[i]);
 51         System.out.println(one + "/" + two + "=" + "\n\n");
 52     }
 53 
 54 //    *
 55     private void doMul(int i) throws IOException {
 56         // TODO Auto-generated method stub
 57         System.out.print("第" + i + "次为:");
 58         int one = (int) (Math.random() * 10);
 59         int two = (int) (Math.random() * 10);
 60         answ[i] = one * two;
 61         String numOne = String.valueOf(one);
 62         String numTwo = String.valueOf(two);
 63         timu[i] = numOne + numTwo;
 64         write(one,two,"*");
 65         System.out.println("答案为" + answ[i]);
 66         System.out.println(one + "*" + two + "=" + "\n\n");
 67     }
 68 //    -
 69     private void doReduce(int i) throws IOException {
 70         // TODO Auto-generated method stub
 71         System.out.print("第" + i + "次为:");
 72         int one = (int) (Math.random() * 10);
 73         int two = (int) (Math.random() * 10);
 74         answ[i] = one - two;
 75         String numOne = String.valueOf(one);
 76         String numTwo = String.valueOf(two);
 77         timu[i] = numOne + numTwo;
 78         write(one,two,"-");
 79         System.out.println("答案为" + answ[i]);
 80         System.out.println(one + "-" + two + "=" + "\n\n");
 81     }
 82 //    +
 83     private void doAdd(int i) throws IOException {
 84         // TODO Auto-generated method stub
 85         System.out.print("第" + i + "次为:");
 86         int one = (int) (Math.random() * 10);
 87         int two = (int) (Math.random() * 10);
 88         answ[i] = one + two;
 89         String numOne = String.valueOf(one);
 90         String numTwo = String.valueOf(two);
 91         timu[i] = numOne + numTwo;
 92         write(one,two,"+");
 93         System.out.println("答案为" + answ[i]);
 94         System.out.println(one + "+" + two + "=" + "\n\n");
 95     }
 96 //存储写入
 97     private void write(int one,int two,String f ) throws IOException {
 98         // TODO Auto-generated method stub
 99         fw=new FileWriter(file,true);
100         BufferedWriter bw=new BufferedWriter(fw);
101         bw.write(one+f+two+"=");
102         bw.newLine();// 表示换行
103         bw.write("*");
104         bw.newLine();// 表示换行
105         bw.flush();// 清空缓冲区
106         bw.close();// 关闭输出流
107     }
108 //测试判断区
109     public void judge() throws IOException {
110         //首先,读文件
111         Scanner sc=new Scanner(System.in);
112         BufferedReader br = null;
113         fr = new FileReader(file);
114         br = new BufferedReader(fr);
115         String s = null;
116         int i=0;
117         while ((s = br.readLine())!=null) {
118             
119             if (s.equals("*")) {
120                 System.out.println("请输入答案:");
121                 @SuppressWarnings("unused")
122                 int a = sc.nextInt();
123                 if(a==answ[i]) {
124                     
125                 }
126                 else
127                     wrongNum++;
128             } else {
129                 System.out.println(s);
130             }
131 
132         }
133         fr.close();
134         System.out.println("一共错了"+wrongNum+"个!");
135     }
136 }
import java.io.IOException;public class Test {public static void main(String[] args) throws IOException {// TODO Auto-generated method stubTest t=new Test();t.comeTrue();}private void comeTrue() throws IOException {// TODO Auto-generated method stubCreat c=new Creat();c.creat();c.judge();}}

 

转载于:https://www.cnblogs.com/msdog/p/9966870.html

http://www.lbrq.cn/news/960247.html

相关文章:

  • 特色个人网站/百度一下官方网址
  • 长沙移动网站建设哪家好/百度网络营销app
  • 网站建设主要用什么软件/如何注册百度账号
  • 怎样建设网站客服服务/上海网站关键词排名
  • 重庆奉节网站建设/网上推广用什么平台推广最好
  • 网站建设制作软件/网站推广的方法和途径
  • 做跨境电商被骗了三万/seo顾问是什么职业
  • 购物商城网站开发目的文档/市场营销策略
  • 洛阳做网站的公司/东莞做网站公司电话
  • 网站备案多久做一次/网络营销试卷
  • 黄石建委网工程建设城建网站/网站关键词怎么优化排名
  • 网址导航系统/网站seo优化公司
  • jquery 单击input输入框弹出选择框多用于人才类网站/今日头条指数查询
  • 宝安网站建设哪家便宜/seo优化是怎么优化的
  • 做网站怎么弄/网络营销的种类有哪些
  • 可做宣传的网站都有哪些/跨界营销案例
  • 南京做网站开发 待遇/邢台市seo服务
  • 小组网站建设方案书/自己如何制作网站
  • 景区网站建设材料/电脑系统优化工具
  • 做收费网站/太原推广团队
  • 做网站公司法人还要拍照吗/外包网站有哪些
  • wordpress博客 centtos/seo整站优化技术培训
  • 做外贸网站挣钱吗/企业网站建设的一般要素
  • 做网站推广维护需要学些什么/正规的培训学校
  • 介绍在家里做的点心的网站/信息流优化师面试常见问题
  • 网站开发的案例分析模板/阿里大数据分析平台
  • 武进常州做网站/关键词排名查询工具有什么作用?
  • 建站软件免费版下载/成都网站关键词推广
  • 宿迁网站制作公司/教育培训网站
  • 页游网站如何做推广/app推广平台
  • Glary Utilities(系统优化工具) v6.20.0.24 专业便携版
  • mysql 性能优化入门
  • 一次多架构镜像构建实战:Docker Buildx + Harbor 踩坑记录
  • 小红书获取关键词列表API接口详解
  • 网络编程-java
  • “重复”定义函数的睿智(Python/与ai助手“智普清言”深度交流)