C language one, two arrays

Source: Internet
Author: User

I. PTA Lab Assignment Topic 1:7-4 simplified insertion sort 1. PTA Submission List

2. Design Ideas

1.定义整形变量N,temp,i.2. Enter n
3.通过for(i=1;i<=N;i++)的循环语句来输入数组从小到大排好顺序好的数组a[i]4. Enter the number to be inserted, expressed in array a[0].
5.通过or(i=0;i<N;i++)的循环语句,从i=0开始判断是否a[i]>a[i+1]6.a[i]>a[i+1],temp=a[i+1];a[i+1]=a[i];a[i]=temp;
' 7. Finally output a new array via the for (i=0;i<=n;i++) loop statement A[i]

3. Code

4. Problems encountered in debugging process and PTA Submission List situation description.

' does not represent the inserted value in an array, not a good representation of the new array inserted

Topic 2:7-7 Find Saddle point 1. PTA Submission List

2. Design Ideas

1.定义整形变量N,i,j,row,col,b,flag;2. Enter N.
3.定义二维数组a[6][6];4. Enter a two-dimensional array through a nested loop for (i=0;i<n;i++) {for (j=0;j<n;j++)}.
5.通过for(i=0;i<N;i++)的循环语句,row=i;col=0;flag=0;6. Again through nested loops for (j=0;j

3. Code

4. Problems encountered in debugging process and PTA Submission List situation description.

' There is no value UI for the output of row=i;col=0;flag=0 before the Loop statement is an answer error.

The topic 3:7-9 judges the upper triangular matrix 1. PTA Submission List

2. Design Ideas

1.定义整形变量T,N,i,j,b,flag;2. Enter T.
3.通过循环for(i=1;i<=T;i++)来输出二维数组的个数.4. Define a two-dimensional array a[10][10];
5.通过for(j=0;j<N;j++){for(b=0;b<N;b++)}的嵌套循环输入二维数组,6. Again through for (j=0;j

3. Code

4. Problems encountered in debugging process and PTA Submission List situation description. Second, this week's topic set PTA Final ranking. Third, peer code peer review 1. Peer evaluation of the names of students

吴军霖 ##2.我的代码、互评同学代码

3. Where do I differ from my classmates ' code? What are the advantages? What style of code do you prefer? If the classmate code is wrong, please help to point out where the problem.

我的方法和军霖的方法不同,我是用的方法是除对角线和列等于0的数组为1,其他的值等于他上一行和值相同列和左边的一个.而军霖的方法是用每列的递差规律来做,例如杨辉三角的二维数组的第0列的每个相邻的数差值为0,以此类推来做.I prefer the army-Lin code, because he uses more ideas and simple ways to do it.
没有什么错 #四、本周学习总结 ##1.你学会了什么? ###1.1 C中如何存储字符串?storing strings in a character array

1.2 What is the end flag of a string and why do you want to end the flag?

遇到字符=‘\0‘就会结束字符串.因为只有结束字符串才能输出字符串. ###1.3 字符串输入有哪几种方法?1. Use the loop statement to output via scanf ("%c").
2.利用循环语句,通过putchar(数组)来输出. ###1.4 数字字符怎么转整数,写个伪代码?For example Array str[i], to Integer: str[i]-' 0 '

1.5 16 binary, binary string how do I turn 10 binary? Write pseudo-code?

2进制 定义字符数组a[100]存储16进制字符串,result储存转化后结果 输入a[] for 第一位to最后一位 若a[]为字符0或1,result=result*2+a[k]-‘0‘; end 输出结果16 binary
Defines a character array a[100] stores 16 binary strings, result stores converted Results
Input a[]
For the first bit to the last one
Characters 0 to 9,result=result16+a[k]-' 0 ';
If a[] is a to f or a to F,result=result
16+a[k]-' a ' or ' a ' +10;
End

2. This week's content, you are not what?

还不会熟练运用排序法的几种方法.Difficulty in solving problems with character array PTA

3. Midterm Summary 3.1 Why do you think you didn't do well?

1.知识点没完全掌握和理解.2. There is no serious review before the exam.

3.2 List the wrong questions.

3.3 The second half semester how to adjust C's study?

' 1. Do not just care about the PTA program, but also to learn the content of the textbook and reference others better code

C language one, two arrays

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.