First, the PTA experimental work Title 1: Judge the upper triangular matrix 1. PTA Submission List
2. Design Ideas
Defines the shaping variable t,t,n,flag, the cyclic variable i,j.
Enter T//t to indicate the number of matrices
For I=1 to i<=t//loop output T matrix and determine if it is the lower triangular matrix
Initialize Flag=0
Input n
Defining an integer array a[n][n]
For J=0 to J<n
For t=0 to T<n
scanf ("%d", &a[j][t]);//output two-dimensional matrix
for (j=0;j<n;j++)
For t=0 to T<j
If a[j][t]!=0
Flag=1//When the matrix is not satisfied
End J
If flag==0
Output Yes//when the array is satisfied
Otherwise
Output No
End I
3. Code
4. Problems encountered in commissioning process and PTA submission List status note
Without flag=0 in the first loop, the answer after the first loop is wrong.
Topic 2: Find the Saddle point 1. PTA Submission List
2. Design Ideas
Defines the shaping variable n,max,min,flag, the cyclic variable i,j.
Input n
Defining a shaped array a[n][n]
For I=0 to I<n
For J=0 to J<n
Input A[I][J]//input data is stored in the array
For I=0 to I<n
Make Max=0
For J=1 to J
# #3. Code
4. Problems encountered in commissioning process and PTA submission List status note
- When you start writing, you mistakenly think that the output max is the subscript, Min is the column below the table, debugging when the output of the answer when the error.
- The Max=j is written as A[max]=a[j] when judging the maximum and minimum values.
Topic 3: Simplified insertion sort 1. PTA Submission List
2. Design Ideas
Define the shaping variable i,n,x,j,t;
Input n//n Array length
Defines an array of a[n];
For I=0 to I<n
Input A[i]//data into an array
End I
Enter the value of X
If A[0]>=x//discusses when x is the smallest value in the sequence
The output X
For I=0 to I<n
Output A[I]
End I//output the value of the entire array
If A[n-1]<=x//discusses when x is the maximum value in the series
For I=0 to I<n
Output A[I]
End I//output entire array
The value of the last output X
When x is in the middle//Discuss the case where x is in the middle of the series
For i=0 to I
3. Code
4. Problems encountered in commissioning process and PTA submission List status note
The first time when writing did not separate discussion three cases, only discussed in the middle of the situation, and finally through the PTA tips corrected.
Second, this week's topic set PTA Final ranking.
PTA Rankings
Third, peer code peer review 1. Mutual evaluation of the name of the students 2. My Code, mutual evaluation of the classmate Code 3. I and the classmate code is different where? What are the respective advantages? What style of code do you prefer? Iv. Study Summary of the Week 1. What did you learn? How do I store strings in 1.1 C?
The C language handles strings as a special one-dimensional array. When storing strings in a character array, include valid characters and the string Terminator ' \ S '.
1.2 What is the end flag of a string and why do you want to end the flag?
The end flag is encountered with the Terminator ' \ ', because the loop is controlled with the end flag.
1.3 What are the methods for string input?
Method: Data initialization, assignment, and input
1.4 Numeric characters How to turn an integer, write a pseudo-code?
Define the Shaping variable number,i,
Defining a character array a[10]
Make I=0
while (A[i]=getchar ())! = ' \ n '
i++
End while//Enter an array
Remember the last character is a[i]= ' + '//put Terminator in array
For i=0 to a[i]!= ' \ n '
number=a[i]-' 0 '//convert to Digital
Output number
End I
End for
1.5 16 binary, binary string how do I turn 10 binary? Write pseudo-code?
Define the Shaping variable number,i,
Defining a character array a[80]
Make I=0
while (A[i]=getchar ())! = ' \ n '
i++
End while//Enter an array
Remember the last character is a[i]= ' + '//put Terminator in array
For i=0 to a[i]!= ' \ n '
Number=number16+a[i]-' 0 '//convert 16 binary to decimal
or number=number2+a[i]-' 0 ' converts binary to decimal
Output number
End I
End for
2. This week's content, you are not what?
- The code of the question read not understand its purpose
- PTA Topic Concentration This has been inscribed for a long time or no train of thought
3. Midterm Summary 3.1 Why do you think you didn't do well?
- Many foundations are not well mastered;
- Learned the knowledge points failed to review in time, it is easy to forget.
- The ability to read programming questions is poor.
- The speed of writing the question is too slow, not enough time.
3.2 List the wrong questions.
Select question
Blank questions
Change the wrong question
Programming questions
Please select the question, fill in the blanks, change the wrong question, the programming question to give a question to explain why wrong, how to change?
3.3 The second half semester how to adjust C's study?
- Review the content of the study in time, solid foundation;
- Exercise your ability to read code and improve your reading speed
C Language Blog Job--one or two-dimensional array