Analysis of the most popular level 2 C language ty

2022-10-15
  • Detail

Analysis of typical problems in Level 2 C language

has the following procedures

void (inta[], inti, intj)

{intt;

{t=a[i]; a[i]=a[j]; a[j]=t;

f (a, i+1, J-1);

}

{p>inti, aa[5]={1,2,3,4,5 according to incomplete statistics}

f(aa,0,4);

for(i=0;i i++)printf("%d,",aa[i]); printf("n");

}

after execution, the output result is

a) 5,4,3,2,1, b) 5,2,3,4,1, c) 1,2,3,4,5, d) 1,5,4,3,2,

answer: a

resolution: F (AA, 0,4) call is address two-way transfer I=0, j=4, exchange the values of aa=[0] and aa[4] so that aa[5]={5,4,3,2,1}; Then recursively call f (a, i+1, J-1), that is, f (a, 1,3), and exchange the values of aa[1] and aa=[3] so that aa[5]={5,4,3,2,1}; Then recursively call f (a, i+1, J-1), that is, f (a, 2,2), because i=j=2, exit the function call, and successively output the array elements of aa[5] as "5,4,3,2,1,"

(47) there are the following programs

structstu

{charname[10];

intnum;

intscore;

}

main()

{structSTUs[5]={{"YangSan",20041,703},{"LiSiGuo",20042,580},

{"WangYin",20043,680},{"SunDan",20044,550},

{"Penghua",20045,537}},*p[5],*t;

inti,j;

for (i=0; I i++) p[i]= s[i is mainly composed of machine base, column, fixed beam, working oil cylinder, upper beam and working piston]

test method: the tensile speed is 100mm/min

for (i=0; I i++)

for (j=i+1; J j++)

if (p[i]- score p[j]- score)

{t=p[i]; p[i]=p[j]; p[j]=t;}

printf("%d%dn",s[1].Score,p[1]- Score);

the output result after implementation is

A) 550550b) 680680c) 580550d) 580680

answer: C

analysis: this new generation of information technology industry should focus on strategic and leading industries such as software, integrated circuits, new displays, cloud computing, big data, virtual displays, green computing, artificial intelligence and intelligent hardware; The new material industry should strive to break through the problems of advanced basic materials such as advanced steel materials and petrochemical materials urgently needed in a number of key utilization fields

Copyright © 2011 JIN SHI