2、needirectory.#include#includeVoid,main(){floaty=1.05;intn=1;FILE*p;****candidatesaddcodehere***/Fprintf(P,%d,%.0f,N,pow(1.05,n));Fclose(P);}Clanguageprogramming02Designprocedure:Thearrayaevery1linesaredividedbythemaindiagonalelementsonline(firstlineswithse
3、condlinedividedbya[0][0],dividedbya[1][1],...),andthentheaarrayiswrittentothePapersubdirectoryinthedirectoryofthecandidatesinthenewfiledesign.dat.#includeVoid,main(){float,a[3][3]={{1.3,2.7,3.6},{2,3,4.7},{3,4,1.27}};FILE*p;****candidatesaddcodehere***/For(i=0;i<3
4、;i++){For(j=0;j<3;j++)fprintf(P,%10.6f,a[i][j]);Fprintf(P,);}Fclose(P);}Clanguageprogramming03Designprocedure:solvingtheproblemof100chickens.Knowncockeach5yuan,hen3yuaneach,chicken1yuan3.Findthesolutiontobuy100chickenswith100yuan.Theresultingsolutioniswrittenintheformato
5、fthe"%d","%d","%d"and"design.dat"oftherooster,henandchick,inthenewPaperfileunderthe"new"fileinthedirectory.#includeVoid,main(){FILE*p;Int,cock,hen,chick;****candidatesaddcodehere***/}Clanguageprogramming04Designprocedure:Z=f(x,y)=10*cos(x-4)+5*sin(Y-2),ifx,yvalu
6、eisanintegerintheinterval[0,10],Ztofindaminimumvalueofx1,Y1,andx1,Y1intheformat"%d,%d"iswrittentothePapersubdirectoryinthedirectoryofthecandidatesinthenewfiledesign.dat.#include#includeVoid,main(){FILE*p;Int,x,y,x1,Y1,float,Z,z1;****candidatesaddcodehere**
7、*/}Clanguageprogramming05Designprocedure:Calculatestheweightvalueofeachcharacterinthestrings.Theso-calledweightvalueistheproductofthepositionvalueofthecharacterinthestringandthevalueoftheASCIIcodeofthecharacter.Thepositionvaluestartsat1andincrementsaccordingly.Writethevalu
8、eofeachcharacterintheformat"%d"tothenewfilePaperinthedesign.datdirectoryinthecandidatedir