This is the 12th day of my participation in the August More Text Challenge. For details, see:August is more challenging

Bubble sort

#include<stdio.h> int main(void) { int arr[10]; int i,j; int temp; for(i=0; i<10; i++) { scanf("%d",&arr[i]); } for(i=0; i<10-1; I++) {// for(j=0; j<10-i-1; J++) {/ / in the condition judgment if it is "less than the number is descending / / if the number is greater than the > is ascending the if (arr [j] > arr [j + 1]) {temp = arr [j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } for(i=0; i<10; i++) { printf("%d\n",arr[i]); } return 0; }Copy the code

Definition of a two-dimensional array

One-dimensional array definition:

Data type Array name [number of elements]Copy the code

Two-dimensional array definition

Data Type Array name [Row][Column] Row * Column = Number of array elementsCopy the code

Requirement: find out the total score of 4 students 3 courses and the total score of each subject

# include < stdio, h > int main (void) {int arr [4] [3] = {,99,100 {88}, {36,42,59}, {60,60,60}, {88,88,88}}; int i,j; for(i=0; i<4; i++) { for(j=0; j<3; Printf ("%d ",arr[I][j]); } printf("\n"); } return 0; }Copy the code

How to find the sum of each row and each column: Requirements: find the total score of four students in three courses and the total score of each subject

Int main (void) {int arr [4] [3] = {,99,100 {88}, {36,42,59}, {60,60,60}, {88,88,88}}; Int sum=0; int sum=0; int i,j; for(i=0; i<4; i++) { for(j=0; j<3; j++) { sum += arr[i][j]; } printf(" %d = %d\n", I +1,sum); sum=0; } sum=0; For (I =0; I =0; i<3; i++) { for(j=0; j<4; j++) { sum+=arr[j][i]; } printf(" %d = %d\n", I +1,sum); sum=0; } return 0; }Copy the code

The chain storage structure can be used for both linear and nonlinear structures. Each node in the chain storage structure is composed of data domain and pointer domain, which increases the storage space.

A line segment with an arrow in a data flow diagram represents a data flow, that is, a channel that transmits data in the direction of the arrow, usually with the name of the data flow next to it.

The tools that can be used in the requirement analysis stage are data flow diagram (DFD), data dictionary (DD) decision tree and decision table.

The object has the following basic characteristics: unique identification, classification, polymorphism, encapsulation, module independence.

Because multiple students can live in a dormitory, that is, multiple students can live in a dormitory, but a student can only live in a dormitory, so the physical dormitory and students is a one-to-many relationship.

Data management has gone through three stages: manual management stage, file system stage and database system stage. The last stage is simple in structure, easy to use, logical, less physical, in all aspects of the best performance, has occupied the dominant position in the database field.