Home > Back-end >  C cycle have a few problems
C cycle have a few problems

Time:09-23

   my problem is that I feel I can be the C language a nested loop iterate through all the data, but in fact he some data into 0, my output is only used for debugging, please bosses, help me to look at someone and I didn't return Pointers, I temporarily don't know how to solve this problem,

CodePudding user response:

Int create_cjlist (Select sclist [], int sccount, Course clist [], int ccount, Student slist [], int scount, Score cjlist [], int * cjcount)
{
Int a [99]={0};
Int I, j, k, z=0, b=0;
Float ZXF=0.0, ZCJ=0.0;
for(i=0; I{
For (j=0; J{
For (k=0; K{
If (STRCMP (sclist [j]. Journal of xh, slist [I] xh)==0)
{
If (STRCMP (sclist [j]. Journal of kh, clist [k]. Kh)==0)
{
Strcpy (cjlist [I]. Xh, slist [I] xh);
Strcpy (cjlist [I]. Xm, slist [I] xm);
Cjlist [I]. Cj/z++=sclist [j]. Journal of cj.
B++;
ZXF +=clist [k]. Xf;
ZCJ +=sclist [j]. Journal of cj;
}
}
}

}
Printf (" % f, % f, % d \ n ", ZXF, ZCJ, b);
Cjlist [I] ZXF=ZXF;
Cjlist [I] ZPJ=ZCJ/cjlist [I] ZXF;
[I]=b;
ZCJ=0; ZXF=0; Z=0; B=0;
}
* cjcount=I;
} these are my code
  • Related