Home > Back-end >  I think both about why the first wrong 1.
I think both about why the first wrong 1.

Time:01-06

#include
Int main ()
{
int n;
Double a, [15].
The scanf (" % d ", & amp; N);
for(int i=0; i{
Lf the scanf (" % ", & amp; A [I]);
}
for(int i=0; i{
for(int j=0; J{
If (a [j] & gt; + 1 a [j]) {
Double TMP=a, [j].
A [j]=a, a + 1 bonus to [j].
A [j + 1)=TMP;
}
}
}
For (int I=n - 1; I>=0; I -)
{
If (I==n - 1)
{
Printf (" % 2 lf ", a [I]);

}
The else {printf (" % 2 lf ", a [I]);
}
}
return 0;
}
2
#include



Struct student
{
Char num [13].
char name[20];
Int s;
int c;
} stu [11].
Int main ()
{
int n;
Int CNT=0;
The scanf (" % d ", & amp; N);
for(int i=0; i{
The scanf (" % d % d % s % s \ n ", & amp; Stu [I]. Num, & amp; Stu [I]. Name, & amp; Stu [I] s, & amp; Stu [I]. C);
If (stu [I] c>=60) {
Cnt++;
}
}
Printf (" % d \ n ", CNT);
for(int i=0; i{
If (stu [I] c>=60)
Printf (" % s % s \ n ", stu [I] num, stu [I] name);
}



return 0;
}
Title:

CodePudding user response:

The
refer to the original poster qq_53415956 response:
# include
Int main ()
{
int n;
Double a, [15].
The scanf (" % d ", & amp; N);
for(int i=0; i{
Lf the scanf (" % ", & amp; A [I]);
}
for(int i=0; i{
for(int j=0; J{
If (a [j] & gt; + 1 a [j]) {
Double TMP=a, [j].
A [j]=a, a + 1 bonus to [j].
A [j + 1)=TMP;
}
}
}
For (int I=n - 1; I>=0; I -)
{
If (I==n - 1)
{
Printf (" % 2 lf ", a [I]);

}
The else {printf (" % 2 lf ", a [I]);
}
}
return 0;
}
2
#include



Struct student
{
Char num [13].
char name[20];
Int s;
int c;
} stu [11].
Int main ()
{
int n;
Int CNT=0;
The scanf (" % d ", & amp; N);
for(int i=0; i{
The scanf (" % d % d % s % s \ n ", & amp; Stu [I]. Num, & amp; Stu [I]. Name, & amp; Stu [I] s, & amp; Stu [I]. C);
If (stu [I] c>=60) {
Cnt++;
}
}
Printf (" % d \ n ", CNT);
for(int i=0; i{
If (stu [I] c>=60)
Printf (" % s % s \ n ", stu [I] num, stu [I] name);
}



return 0;
}
Title:

The first mistake

CodePudding user response:

The
refer to the original poster qq_53415956 response:
# include
Int main ()
{
int n;
Double a, [15].
The scanf (" % d ", & amp; N);
for(int i=0; i{
Lf the scanf (" % ", & amp; A [I]);
}
for(int i=0; i{
for(int j=0; J{
If (a [j] & gt; + 1 a [j]) {
Double TMP=a, [j].
A [j]=a, a + 1 bonus to [j].
A [j + 1)=TMP;
}
}
}
For (int I=n - 1; I>=0; I -)
{
If (I==n - 1)
{
Printf (" % 2 lf ", a [I]);

}
The else {printf (" % 2 lf ", a [I]);
}
}
return 0;
}
2
#include



Struct student
{
Char num [13].
char name[20];
Int s;
int c;
} stu [11].
Int main ()
{
int n;
Int CNT=0;
The scanf (" % d ", & amp; N);
for(int i=0; i{
The scanf (" % d % d % s % s \ n ", & amp; Stu [I]. Num, & amp; Stu [I]. Name, & amp; Stu [I] s, & amp; Stu [I]. C);
If (stu [I] c>=60) {
Cnt++;
}
}
Printf (" % d \ n ", CNT);
for(int i=0; i{
If (stu [I] c>=60)
Printf (" % s % s \ n ", stu [I] num, stu [I] name);
}



return 0;
}
Title:

#include
Struct student
{
Char num [13].
char name[20];
Int g;
int c;
} stu [11].
Int main ()
{
Int n, I, x=0;
The scanf (" % d ", & amp; N);
for(i=0; i{
The scanf (" % d % d % s % s ", & amp; Stu [I]. Num, & amp; Stu [I]. Name, & amp; Stu [I]. J g, & amp; Stu [I]. C);
If (stu [I] c>=60)
{
X++;
}
}
Printf (" % d \ n ", x);
for(i=0; i{
If (stu [I] c>=60)
{
Printf (" % s % s \ n ", stu [I] num, stu [I] name);
}
return 0;
}
}
This is what I write, my wrong, the second right, I don't know why

CodePudding user response:

You put the return 0; Writing in the loop,

CodePudding user response:

Good disorderly, which is written by you oh, caocao, the scanf (" % d % d % s % s \ n ", & amp; Stu [I]. Num, & amp; Stu [I]. Name, & amp; Stu [I] s, & amp; Stu [I]. C); This sentence should not add \ n, num and not in front of the name & amp; symbol
  • Related