1014 C language Grammar definition and C program derivation process program: Bubbling algorithm C program (syntax tree)
1 Read and understand the C language grammar files provided to everyone. 2 refer to this file to write a good understanding version of the real version of the full version of the C language grammar. 3 a C program is given to draw a complete syntax tree that produces the C program using the above grammar. Program: Bubbling algorithm C program
Click this text to view the original (full picture)
1#include <stdio.h>2 3 Main ()4 { 5 inti,j,temp;6 inta[Ten]; 7 8 for(i=0;i<Ten; i++) 9scanf ("%d,",&A[i]); Ten One for(j=0; j<=9; j + +) A{ for(i=0;i<Ten-j;i++) - if(a[i]>a[i+1]) -{temp=A[i]; thea[i]=a[i+1]; -a[i+1]=temp;} - } - for(i=1;i< One; i++) +printf"%5d,", A[i]); -printf"\ n"); + A}
1014 C language Grammar definition and C program derivation process program: Bubbling algorithm C program (syntax tree)