首页 > 其他分享 >OPP面向对象前三次题目总结

OPP面向对象前三次题目总结

时间:2024-04-21 23:11:35浏览次数:17  
标签:OPP String matcher 面向对象 pattern new 题目 public input

一.前言:

 

第一次大作业: 作为三次作业里面最简单的一次作业,第一次作业里面没有什么涉及到那种特别大的程序,并且对类的使用也没有那么的明显,虽然有5道题,但基本上使用面向过程的思维就可以解决完,主要是对java的一些语法和一些方法的训练而已,对于新手来说难度比较适中。尽管如此,由于我当时对题目的重视程度不高,再加上当时忙于辩论赛准备,所以只留了大概3个小时来写最后一题,结果就是最后一题只拿了21分,这也让我第一次专业不及格,不过也有利有弊,至少它让我在之后的题目中更下功夫,每次都提前很久开写。

 

第二次大作业: 第二次作业的难度主要是集中在了试卷类的设计,主要是要实现题目与分数的对应,这里老师推荐我们使用hashmap实现,但由于我没看到总共提示,所以我采用了一个比较去巧的做法就是用两个Arrlist实现试卷类中试卷与分数的一一对应。第一次菜单的程序设计考察的知识点不多,主要是为了让大家初步掌握一下类是如何使用的,以及面对一个大程序的时候我们该如何去划分这个类的职责,也就是设计好每个类需要干什么,进一步便是我们该如何去使用类里面的属性和方法。其中涉及到的类也不多,并且题目已经把类的模版给我们设计好了。对于刚刚接触java不久的学者来说可能难度算是中档难度。(现在看来真的已经算是很简单的了),本题对类使用的必要性提高了很多很多,需要大家能够对类的使用有了比较清晰的了解。(但我这题基本上是面向过程来写的…)这对于一个接触java不久的人来说难度可能已经算上比较难的了(现在看来感觉可能也就中档难度)

 

第三次大作业: 这次的第三次的作业难度在第二次作业的难度上又提升了一个档次,基本上不使用面向对象的思维很难能够通过这个测试点了。另外就是这个测试点非常难找,即使放到现在我也感觉这道题的难度可以算得上是很难很难了,还有一个问题就是一开始给的样例其实没有包含一些可能的情况,在那些情况下我们不知道标准输出是什么只能去猜(最后我也还有3个测试点过不了)。不过我也因此发现了我的一个问题,那就是我的正则表达式学的真的很差,我最后过不了的点应该也是没识别出输入的错误格式,说明我应该恶补一下正则表达式了。

 

二.设计与分析:

第一次大作业:

最后一题类图:

 

最后一题源码:

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

class Question {
    String questionNumber;
    String questionContent;
    String answer;

    public Question(String questionNumber, String questionContent, String answer) {
        this.questionNumber = questionNumber;
        this.questionContent = questionContent;
        this.answer = answer;
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numQuestions = scanner.nextInt();
        scanner.nextLine();
        List<Question> questions = new ArrayList<>();
        for (int i = 0; i < numQuestions; i++) {
            String questionInfo = scanner.nextLine();
            String patternString = "#N:(\\d+) #Q:([\\d+]+)= #A:(\\d+)";
            Pattern pattern = Pattern.compile(patternString);
            Matcher matcher = pattern.matcher(questionInfo);
            String questionNumber = " ";
            String questionContent = " ";
            String answer = " ";
            if (matcher.find()) {
                questionNumber = matcher.group(1);
                questionContent = matcher.group(2);
                answer = matcher.group(3);
            }
            questions.add(new Question(questionNumber, questionContent, answer));
        }
        List<String> answers = new ArrayList<>();
        String answerInfo = scanner.nextLine();
        while (!answerInfo.equals("end")) {
            String[] parts = answerInfo.split(" ");
            for (String part : parts) {
                if (part.startsWith("#A:")) {
                    String answer = part.split(":")[1];
                    answers.add(answer);
                }
            }
            answerInfo = scanner.nextLine();
        }
        for (int i = 0; i < numQuestions; i++) {
            Question question = questions.get(i);
            String answer = i < answers.size() ? answers.get(i) : "";
            System.out.println(question.questionContent + "=~" + answer);
        }
        boolean flag =false;
        for (int i = 0; i < answers.size(); i++) {
            String answer = answers.get(i);
            boolean isCorrect = true;
            String str=Integer.toString(i);
            for (Question question : questions) {
                if(str.equals(question.questionNumber)){
                if (question.answer.equals(answer)) {
                    isCorrect = false;
                    }
                break;
                }
            }
            if (flag) {
                System.out.print(" ");
            }
            System.out.print(isCorrect);
            flag =true;
        }
    }
}

 

这次是没能是拿满分,但是主要原因是思路不够清晰,不过在这个题目里面我类只有一个:( 这个本质上是英文我还没能重面向过程的思维中转变过来,这也让我的代码拓展性很差;

 

 

第二次大作业:

最后一题类图:

 

 

更多的时间所以拿到了满分(但实际啥有一个致命的缺陷没有被我察觉,后面第三次的时候会讲)

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
class Question {
    String questionNumber;
    String questionContent;
    String answer;
    public Question(String questionNumber, String questionContent, String answer) {
        this.questionNumber = questionNumber;
        this.questionContent = questionContent;
        this.answer = answer;
    }
}
class Text{
    public ArrayList<Question> text;
    public ArrayList<Integer> Score;
    public Text() {
        text= new ArrayList<Question>();
        Score=new ArrayList<Integer>();
    }
    public void addQuestion(Question question) {
        text.add(question);
    }
    public void addScore(int score){
        Score.add(score);
    }
}
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        List<String> input= new ArrayList<>();
        String str=scanner.nextLine();
        while(!str.equals("end")) {
            input.add(str);
            str=scanner.nextLine();
        }
        Question[] questions=new Question[100];
        Text[] texts=new Text[100];
        for(int i=0;i<input.size();i++){
            if(input.get(i).startsWith("#N")){
                String[] parts =input.get(i).split(" *#A: *| *#Q: *| *#N: *");
                questions[Integer.parseInt(parts[1])]=new Question(parts[1],parts[2],parts[3]);
            }
        }
        for(int i=0;i<input.size();i++){
            if(input.get(i).startsWith("#T")){
                int sum=0;
                Text tempText=new Text();
                String patternString = "#T:(.*)";
                Pattern pattern = Pattern.compile(patternString);
                Matcher matcher = pattern.matcher(input.get(i));
                String content = "";
                if (matcher.find()) {
                    content = matcher.group(1);
                }
                String[] parts = content.split(" |-");
                for (int j=1;j<parts.length;j=j+2) {
                    tempText.addQuestion(questions[Integer.parseInt(parts[j])]);
                    tempText.addScore(Integer.parseInt(parts[j+1]));
                }
                texts[Integer.parseInt(parts[0])]=tempText;
                for(int x=0;x<tempText.Score.size();x++){
                    sum+=tempText.Score.get(x);
                }
                if(sum!=100){
                    System.out.printf("alert: full score of test paper%d is not 100 points\n",Integer.parseInt(parts[0]));
                }
            }
        }
        for(int i=0;i<input.size();i++){
            if(input.get(i).startsWith("#S")){
                int sum=0;
                List<Integer> scores=new ArrayList<>();
                String patternString = "#S:(.*)";
                Pattern pattern = Pattern.compile(patternString);
                Matcher matcher = pattern.matcher(input.get(i));
                String content = "";
                if (matcher.find()) {
                    content = matcher.group(1);
                }
                String[] parts = content.split(" #A:");
                if(texts[Integer.parseInt(parts[0])]==null){
                    System.out.println("The test paper number does not exist");
                }
                else {
                    for (int j = 1; j-1< texts[Integer.parseInt(parts[0])].text.size(); j++) {
                        if(j<parts.length){
                            System.out.printf("%s~%s~", texts[Integer.parseInt(parts[0])].text.get(j - 1).questionContent, parts[j]);
                            if (texts[Integer.parseInt(parts[0])].text.get(j - 1).answer.equals(parts[j])) {
                                System.out.println("true");
                                scores.add(texts[Integer.parseInt(parts[0])].Score.get(j - 1));
                            } else {
                                System.out.println("false");
                                scores.add(0);
                            }
                        }else {
                            System.out.println("answer is null");
                            scores.add(0);
                        }
                    }
                    for (int x = 0; x < scores.size(); x++) {
                        sum += scores.get(x);
                        if (x != 0) {
                            System.out.print(" ");
                        }
                        System.out.printf("%d", scores.get(x));
                    }
                    System.out.println("~" + sum);
                }
            }
        }
    }
}

这次大作业花了更多的时间所以拿到了满分(但实际啥有一个致命的缺陷没有被我察觉,后面第三次的时候会讲)

但其实主要是找到了思路,尽管没用上hashmap也实现了题目要求的功能,这次我只写了两个类,而且大部分功能还是在主函数中实现的,这一点还是面向过程思想的问题

 

第三次大作业:

最后一题类图:

 最后一题源码:

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
class Student{
    private String studentName;
    private String studentNum;
    public Student(String studentNum,String studentName){
        this.studentNum=studentNum;
        this.studentName=studentName;
    }
    public String getStudentName() {
        return studentName;
    }
    public String getStudentNum() {
        return studentNum;
    }
    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }
    public void setStudentNum(String studentNum) {
        this.studentNum = studentNum;
    }
}
class Question {
    String questionNumber;
    String questionContent;
    String answer;
    boolean flag;
    public Question(String questionNumber, String questionContent, String answer) {
        this.questionNumber = questionNumber;
        this.questionContent = questionContent;
        this.answer = answer;
        flag=true;
    }
}
class Text {
    public ArrayList<Question> text;
    public ArrayList<Integer> Score;
    public Text() {
        text = new ArrayList<Question>();
        Score = new ArrayList<Integer>();
    }
    public void addQuestion(Question question) {
        text.add(question);
    }
    public void addScore(int score) {
        Score.add(score);
    }
}
class StudentList{
    public ArrayList<Student> list;
    public StudentList() {
        list= new ArrayList<Student>();
    }
    public void addStudent(Student newStudent) {
        list.add(newStudent);
    }
}
class Answer{
    String answerNum;
    String answerContent;
    public Answer(String answerNum,String answerContent){
        this.answerNum=answerNum;
        this.answerContent=answerContent;
    }
}
public class Main{
    public static void main(String[] args) {
        StudentList studentList=new StudentList();
        ArrayList<Answer> answerArrayList=new ArrayList<Answer>();
        Scanner scanner = new Scanner(System.in);
        List<String> input = new ArrayList<>();
        String str = scanner.nextLine();
        while (!str.equals("end")) {
            input.add(str);
            str = scanner.nextLine();
        }
        Question[] questions = new Question[1000];
        Text[] texts = new Text[1000];
        for (int i = 0; i < input.size(); i++) {
            if (input.get(i).startsWith("#X")) {
                Student tempStudent = new Student("", "");
                String patternString = "#X:(.*)";
                Pattern pattern = Pattern.compile(patternString);
                Matcher matcher = pattern.matcher(input.get(i));
                String content = "";
                if (matcher.find()) {
                    content = matcher.group(1);
                }
                String[] parts = content.split("-");
                boolean isRight = true;
                for (int j = 0; j < parts.length; j++) {
                    pattern = Pattern.compile("(^\\d+) (.*)");
                    matcher = pattern.matcher(parts[j]);
                    if (!matcher.find() || !matcher.group(2).matches("[^0-9]*")) {
                        System.out.println("wrong format:" + input.get(i));
                        isRight = false;
                        break;
                    }
                }
                if (isRight) {
                    for (int j = 0; j < parts.length; j++) {
                        pattern = Pattern.compile("(^\\d+) (.*)");
                        matcher = pattern.matcher(parts[j]);
                        if (matcher.find() && matcher.group(2).matches("[^0-9]*")) {
                            tempStudent.setStudentNum(matcher.group(1));
                            tempStudent.setStudentName(matcher.group(2));
                            studentList.addStudent(tempStudent);
                            tempStudent = new Student("", "");
                        } else {
                            System.out.println("wrong format:" + input.get(i));
                        }
                    }
                }
            }
        }
        for (int i = 0; i < input.size(); i++) {
            if (input.get(i).startsWith("#N")) {
                Pattern pattern = Pattern.compile("#N:(.*?) #Q:(.*?) #A:(.*?)$");
                Matcher matcher = pattern.matcher(input.get(i));
                if (matcher.find()) {
                    questions[Integer.parseInt(matcher.group(1))] = new Question(matcher.group(1),matcher.group(2), matcher.group(3));
                }
                else{
                    System.out.println("wrong format:"+input.get(i));
                }
            }
        }
        for (int i = 0; i < input.size(); i++) {
            if (input.get(i).startsWith("#D")) {
                int sum = 0;
                Text tempText = new Text();
                String patternString = "#D:N-(.*)";
                Pattern pattern = Pattern.compile(patternString);
                Matcher matcher = pattern.matcher(input.get(i));
                if (matcher.find()) {
                    questions[Integer.parseInt(matcher.group(1))].flag=false;
                }else{
                    System.out.println("wrong format:"+input.get(i));
                }
            }
        }
        for (int i = 0; i < input.size(); i++) {
            if (input.get(i).startsWith("#T")) {
                int sum = 0;
                Text tempText = new Text();
                String patternString = "#T:(.*)";
                Pattern pattern = Pattern.compile(patternString);
                Matcher matcher = pattern.matcher(input.get(i));
                String content = "";
                if (matcher.find()) {
                    content = matcher.group(1);
                }
                boolean isRight = true;
                String[] parts = content.split(" ");
                boolean isTrue = true;
                for (int j = 1; j < parts.length; j++) {
                    pattern = Pattern.compile("(^\\d+)-(\\d+)");
                    matcher = pattern.matcher(parts[j]);
                    if (!matcher.find()) {
                        System.out.println("wrong format:" + input.get(i));
                        isTrue = false;
                        break;
                    }
                }
                if (isTrue) {
                    for (int j = 1; j < parts.length; j++) {
                        pattern = Pattern.compile("(^\\d+)-(\\d+)");
                        matcher = pattern.matcher(parts[j]);
                        if (matcher.find()) {
                            tempText.addQuestion(questions[Integer.parseInt(matcher.group(1))]);
                            tempText.addScore(Integer.parseInt(matcher.group(2)));
                        } else {
                            System.out.println("wrong format:" + input.get(i));
                            isRight = false;
                            break;
                        }
                    }
                    if (isRight) {
                        texts[Integer.parseInt(parts[0])] = tempText;
                        for (int x = 0; x < tempText.Score.size(); x++) {
                            sum += tempText.Score.get(x);
                        }
                        if (sum != 100) {
                            System.out.printf("alert: full score of test paper%d is not 100 points\n", Integer.parseInt(parts[0]));
                        }
                    }
                }
            }
        }
        for(int i = 0; i < input.size(); i++) {
            if (input.get(i).startsWith("#S")) {
                int sum = 0;
                List<Integer> scores = new ArrayList<>();
                String patternString = "#S:(.*)";
                Pattern pattern = Pattern.compile(patternString);
                Matcher matcher = pattern.matcher(input.get(i));
                String content = "";
                if (matcher.find()) {
                    content = matcher.group(1);
                }
                String[] parts = content.split(" ");
                if (texts[Integer.parseInt(parts[0])] == null) {
                    System.out.println("The test paper number does not exist");
                } else {
                    boolean flag1 = true;
                    for (int v = 2; v < parts.length; v++) {
                        pattern = Pattern.compile("#A:(\\d+)-(.*)");
                        matcher = pattern.matcher(parts[v]);
                        if (matcher.find()&&!matcher.group(2).contains("-")) {
                            answerArrayList.add(new Answer(matcher.group(1), matcher.group(2)));
                        } else {
                            System.out.println("wrong format:" + input.get(i));
                            flag1 = false;
                            break;
                        }
                    }
                    if (flag1) {
                        for (int j = 1; j <= texts[Integer.parseInt(parts[0])].text.size(); j++) {
                            int p = 0;
                            boolean flag = false;
                            for (; p < answerArrayList.size(); p++) {
                                if (j == Integer.parseInt(answerArrayList.get(p).answerNum)) {
                                    flag = true;
                                    break;
                                }
                            }
                            if (flag) {
                                if (texts[Integer.parseInt(parts[0])].text.get(j - 1) == null) {
                                    System.out.println("non-existent question~0");
                                    scores.add(0);
                                } else {
                                    if (texts[Integer.parseInt(parts[0])].text.get(j - 1).flag) {
                                        System.out.printf("%s~%s~", texts[Integer.parseInt(parts[0])].text.get(j - 1).questionContent, answerArrayList.get(p).answerContent);
                                        if (texts[Integer.parseInt(parts[0])].text.get(j - 1).answer.equals(answerArrayList.get(p).answerContent)) {
                                            System.out.println("true");
                                            scores.add(texts[Integer.parseInt(parts[0])].Score.get(j - 1));
                                        } else {
                                            System.out.println("false");
                                            scores.add(0);
                                        }
                                    } else {
                                        System.out.println("the question 2 invalid~0");
                                        scores.add(0);
                                    }
                                }
                            } else {
                                System.out.println("answer is null");
                                scores.add(0);
                            }
                        }
                        boolean flag = false;
                        int z = 0;
                        for (; z < studentList.list.size(); z++) {
                            if (studentList.list.get(z).getStudentNum().equals(parts[1])) {
                                flag = true;
                                break;
                            }
                        }
                        if (flag) {
                            System.out.printf("%s %s: ", studentList.list.get(z).getStudentNum(), studentList.list.get(z).getStudentName());
                            for (int x = 0; x < scores.size(); x++) {
                                sum += scores.get(x);
                                if (x != 0) {
                                    System.out.print(" ");
                                }
                                System.out.printf("%d", scores.get(x));
                            }
                            System.out.println("~" + sum);
                        } else {
                            System.out.println(parts[1] + " not found");
                        }
                    }
                }
            }
        }
    }
}

这次代码的要求比两次看上去没多几个要求,但事实上,我为此多创了三个类,因为这次不再是按顺序识别题目(固然也有我前面两次偷懒的原因在)

不过在加上这些基础的功能后,很快我就遇到了最大的问题--格式检测的问题;由于在之前没有进行过这样的检测,我对正则表达式的运用非常生疏(再加上样例中给的格式错误的实例只有一个,导致我不太清楚什么样的格式算正确什么样的算错误,于此同时我还发现我之前的代码据让由于一个i的错误赋值,二实际上没办法实现题目要求的功能,而前面满分只是刚好没测出来,这让我捏了一把冷汗,还好再这次及时发现了,别人再以后一堆错误的时候都你不知道从哪里改。

 

三.踩坑心得:

在三次练习中我犯过大大小小的的不少错误其中我觉得比较有价值的有以下几个:

【1】首先就是要在完全理解题目的情况下在着手写代码,就比如我第一道题,其实本质上你题几小时是完全写得完的,但是我当时太急了还没解完全题目就开始写,写着写着发现不对有反反复复的的改,最后也没改完,还有第三次也是,等我最后写完了踩发现他对于数据格式有要求当时无人都麻了,有添加了许多重复代码,最后也没有完全解决,所以说磨刀真的是不误砍柴工;

【2】还有就是最好在写代码的同时写点注释,就比如我在第二次作业的时候代码写的太精简了,一共就115行,结果过了一星期自己想倒回来看代码的时候忘了很多浪费了很多时间;

【3】在开始写代码之前最好先考虑好用哪些知识,就比如说hashmap,第三次我还是没用上,但实际上用起来一个不难,不过我在一开始写的时候没有考虑,后面也就没有改;

【4】最后,不要太把测试点当回事,测试点给的情况往往是有限的,最重要的是充分理解题目

 

四.改进建议:

【1】首先就是要把功能全集成到类里面,这样才能做到真正的面向对象思维,并且也更方便后续扩展功能和程序;

【2】把hashmap用起来,这样可以节省很多代码

【3】把数据全储存到类中,我的题目都还没有创建类:(

 

五.总结:

主要困难:


(1)从思维上来看的话目前主要困难还是在于没有很好地弄清楚面向对象的思维到底是如何的,而且C语言的面向过程的思想已经可以说是根深蒂固了,对于以后的越来越难的大作业来说,自己还是得尽快地掌握面向对象的思维和面向对象的逻辑。

(2)从逻辑上来看的话,对java的一些方法还没有形成一种“本能的反应”,比如说第三次菜单大作业中的输入本来可以直接使用java当中提供的substring方法,直接通过长度来判断每一次的输入是什么状态,但是自己没有意识到这一点,而是本能的用C语言那一套逻辑,选择去判断是不是题目,是不是数字,是数字的话后面跟着的又是不是数字,不是数字的话那是不是正确的输入呢?导致一系列判断语句下来,代码的复杂度上升了,自己的头也快秃了。

II.改进建议:

(1)先通过一些小的练习题来让自己能够理解并掌握一下面向对象的思维和逻辑框架。

(2)通过包括但不仅限于看网上的资料,写小题目,看书等方式让自己对java的一些语法和方法形成一种“条件反射”,能够在以后的学习中遇到什么样的困难能够直接联想到java当中是不是有更为简便,更为直接的方法来使用,这样可以减少时间成本,也可以简化一下自己的算法。

 
(3)对教学相关的建议:

I. 老师方面:以自己的理解力来说的话感觉老师讲的有点儿太快了点儿,有些挺难的知识点老师很快的就讲完了,但是自己连反应过来的时间都没有。有的时候在QQ上问老师问题,老师没有理我,不知道是不是自己的问题好愚蠢还是老师忘记回了(哭哭)。

II. 课程方面:课程设置体系是让学生自学语法,上课主要讲其他知识点,但其实说实话能够真正的去学习语法的学生是很少的,我的建议是应该是每周加一次java课用来补语法。

 

标签:OPP,String,matcher,面向对象,pattern,new,题目,public,input
From: https://www.cnblogs.com/whyyyy/p/18149714

相关文章

  • PTA题目集1~3的总结
    目录:1)前言2)设计与分析3)踩坑心得4)改进建议5)总结1.前言:Java作为本学期的新学语言,难度相较于上学期的c语言有很大提升,由易到难的过程也更加考验我们的学习和理解能力。前三次题目集重点考核类设计及类间关系设计,以及正则表达式的应用等。并且在每次题目集的题目数量不多的情......
  • 第一次题目总结
    前言:本次发布的题目集1-3,主要是对类和对象的使用的考察,题量比较适中,难度设置合理,如风扇类设计比较简单,整体就是为了熟悉类的使用,后续的题目加入了一些要求,加强对类和对象的熟悉,难点集中在每次的答题系统迭代上,非常考验类之间的关联使用。每次题目集都会有一些简单的基础题目来熟......
  • PTA题目集1~3的总结
    1.前言[1]知识点:这三次题目集是针对对象和类展开的,主要是String类和正则表达式的运用。要运用到String.split,String.substring等,和通过正则表达式来判断字符串是否符合格式和拆分字符串。[2]题量:这三次题目集的题量不算很大,每次的题量有所减少,但是题目难度有所提升,每题......
  • PTA前三次题目集总结
    一.前言三次PTA题目集过后,算是彻底打击了我的自信心,PTA内容不在只是简单的对语法问题的考察,真正的从“基础”转到“面向对象”,随之而来的是更多的代码量,及消耗我们更多的时间。要学习新的内容并投入实践,和更多代码量给我带来更多的报错问题和非零返回问题,无不在告诉我这次学习有......
  • 前三次PTA题目集总结
    1.前言:前三次作业主要都是写答题判断程序,由于这学期才接触java,所以一开始对于怎么写,以及java语法有点不太适应。后来学习到“类”这个强大的工具和正则表达式,但因为并不熟练,所以写起来十分艰难。这三次题目难度逐级提升,都在原本的基础上添加了新的内容与知识点。类和对象的使用,关......
  • opp1~3总结与反思
    23201927-杨民星-第一次博客第一次opp题集:题目数量:5题题目难度:中等偏难知识点:ArrayList变长数组,排序,正则表达式,单一职责原则等对于这次opp题集,我遇到了很多不同的情况,如下细说:第一、前几题其实都是比较简单的题目,就是让我们认......
  • 题目集1~3的总结
    一、前言一到三次题目集主要考察的知识点有类与对象的设计、类与方法的调用、数组、链表等;题量稍大,题目难度具有挑战性,需要经过认真的思考。二、设计与分析1、题目一:(1)题目:设计实现答题程序,模拟一个小型的测试,要求输入题目信息和答题信息,根据输入题目信息中的标准答案判断答......
  • 关于题目集1~3的总结
    前言前三次pta作业最后一题都是答题判题程序,题目难度逐级提升但写完后收获也不小。首先一点是需求分析,不应上来就写代码而是从业务需求整体分析,在确定好程序的层次结构再开始实现相应的功能。在这三次作业中,将所学的编程知识很好地运用,其次,三次作业也同样考验我们的自学能力比......
  • NCHU题目集1~3的总结
    目录一.前言二.设计与分析三.采坑心得四.改进建议五.总结前言知识点总结题目集一字符串处理对输入的字符串进行对应的匹配与确认,找到对应的字符串的内容,将对应字符串中不合规范的内容进行处理,合格后直接存储。字符串的比对,满足要求的字符串进行输出和相应......
  • PTA前三次题目集总结
    以下内容是我对PTA三次习题作业最后一题的思路,源码以及总结学到的java知识大多都来自写题目集这些题目对我对java的认知与学习起到了不小的帮助答题判题程序-1题目内容设计实现答题程序,模拟一个小型的测试,要求输入题目信息和答题信息,根据输入题目信息中的标准答案判断答题的......