First, the PTA experimental work Title 1:7-2 to find the number of integers in the sequence of the most occurrences of 1. PTA Submission List
2. Design Ideas
Begin输入整数个数N定义数组a[N]输入数组afor(i 0 to N-1){//进行N次判断for(j 0 to N-1)if(a[i]和a[j]相等)count加一i等于0//第一次判断使max=count; n=i;//n放下标,max放次数i不等于0且count大于max使max=count; n=i;//重新赋值count为0//每次循环count为0 }输出a[n],maxEnd
3. Code
4. Problems encountered in debugging process and PTA Submission List situation description.
- Test point
Error code
The first time to write the idea of parity trouble, set up two arrays
Topic 2:7-7 Find Saddle point 1. PTA Submission List2. Design Ideas
Begin输入数组a[i][j]row=col=0;//找行最大的数 for(i 0 to n-1)for(j 0 to n-1)if(a[i][j]大于等于a[i][col])row=i;col=j;//存放最大数的行列if(j==n-1)b[i]存放最大数,f[i]存放最大数所在列 col=0;//归0同上面的方法,找列最小的数for(i 0 to n-1)for(j 0 to n-1)if(b[i]和d[j]相等) {//判断最小数和最大数是否存在相等 输出所在的行列数flag=1;}//flag作是否有的标志 if(flag为0)则没有End
3. Code4. Problems encountered in debugging process and PTA Submission List situation description.
Because I have a lot of methods variable name, so I can only calm down to the example of a step-by-step change
The topic 3:7-8 Addition Table of 1. PTA Submission List2. Design Ideas
Begin输入repeatfor(i 1 to repeat)//作repeat次运算 输入数组长度n并定义a[n+1]for(i 1 to n)//第一行第一列为1a[0][i]=i;a[i][0]=i;for(i 1 to n){//计算每一行的数 for(j 1 to n)a[i][j]=a[0][j]+a[i][0];第一行先输出‘+’再输出1最后一个数没有空格且换行下面的行输出同第一行End
3. Code4. Problems encountered in debugging process and PTA Submission List situation description.
Without noticing the last number without a space
Second, this week's topic set PTA Final ranking.
Third, peer code peer review 1. Peer evaluation of the names of students
-
Huang Guangqui
2. My Code, peer code
- yellow classmate's code
-
My Code
3. What's the difference between me and my classmates ' code? What are the respective advantages? What style of code do you prefer? If the classmate code is wrong, please help to point out where the problem.
- on the definition array I first enter n, then define the array, and the yellow classmate is the direct definition of a[10][10].
When I enter the first column of the first row, I'm looping together, and the yellow classmates are separate.
Output I am divided into the first row and the other lines, Huang classmate is divided into the first row of the first column and the remaining lower triangle.
-
Feel the difference
Four, this week study summary 1. What did you learn? How do I store strings in 1.1 C?
-
Stored in a one-dimensional character array
1.2 What is the end flag of a string, and why do you want to end the flag?
-
' \ _ ' can end when working with strings
1.3 What are the methods for string input?
- while ((A[i]=getchar ())! = ' \ n ')
i++;
a[i]= ' + ';
- sacnf ("%s", a);
-
Gets (a);
1.4 Numeric characters How to turn an integer, write a pseudo-code? Enter numeric characters to output numeric characters-' 0 '
1.5 16 binary, binary string how do I go to 10 binary? Write pseudo-code?
-
Hexadecimal
hexadecimal array a[n]for (i=0;a[i] not ' \ n '; I plus a) if the character is a number n=n*16+a[i]-' 0 ' if the character is a lowercase letter n=n*16+a[i]-' a ' + 10 If the character is in uppercase n=n*16+a[i]-' a ' +10 output n
-
Binary
binary array a[n]for (I=0;a[i] not ' n '; I plus a) n=n* 2+a[i]-' 0 ' output n
2. This week's content, you're not what?
- 1. The two-point lookup method is still not very understanding
- 2. Direct Insert sort It's not quite understood.
-
3.pta7-9 judging the upper triangular matrix the input and output should be the same as the example of the topic, but the answer is wrong
3. Midterm Summary 3.1 Why do you think you didn't do well?
- For the basic knowledge of some forgotten, some unfamiliar
- Lack of ability to read programs
There is no good idea of a programming problem in a short time.
3.2 List the wrong questions.
These two questions are the same knowledge point, in the opposite direction, the scope of the static local variable is defined by the source file scope of the variable, the life cycle is from the call to the end of the program.
At first did not understand the term that expression is how to calculate, the idea is broken.
3.3 The second half semester how to adjust C's study?
- Class School: Do a good preview homework, for the wrong problem to be careful analysis, the wrong problem to understand
- PTA: Do your own ability to do more problems, improve efficiency, do not work hard
- Blog Park: For the weekly study serious analysis, summarize gains and losses, set small goals
- Classroom: Listen to the teacher's example, as far as possible to understand the knowledge points, lay a good foundation, interactive Independent Thinking
On the machine test: in advance preparation, the must test code to understand, in the exam is not nervous, the topic test instructions understand, wisp clear ideas, and then hit the code
C Language Blog Job-one or two-dimensional array