要怎么輸出某一個(gè)或者全部學(xué)生的成績(jī)
struct student{
? ? float english;
? ? float math;
? ? float yuwen;
};
int main(){
? ? struct student st[7];
? ? st[1].math=30.4;
? ? st[1].english=3.4;
? ? st[1].yuwen=88.90;
? ? printf("%d",st[1].yuwen);
}
struct student{
? ? float english;
? ? float math;
? ? float yuwen;
};
int main(){
? ? struct student st[7];
? ? st[1].math=30.4;
? ? st[1].english=3.4;
? ? st[1].yuwen=88.90;
? ? printf("%d",st[1].yuwen);
}
2022-11-18
舉報(bào)
2023-08-21
2023-07-13
#include <iostream> #include <string> struct Person { ? ?std::string name; ? ?int age; ? ?std::string occupation; };
int main() { ? ?Person person; ? ?person.name = "Alice"; ? ?person.age = 25; ? ?person.occupation = "Engineer"; ? ?std::cout << "Person Details:" << std::endl; ? ?std::cout << "Name: " << person.name << std::endl; ? ?std::cout << "Age: " << person.age << std::endl; ? ?std::cout << "Occupation: " << person.occupation << std::endl; ? ?return 0; }
2022-11-19
我覺(jué)得這個(gè)應(yīng)該可以
#include <stdio.h>
struct student {
float english;
float math;
float yuwen;
};
int main() {
struct student st[7];
st[1].math = 30.4;
st[1].english = 3.4;
st[1].yuwen = 88.90;
printf("%d, %d, %d", st[1].yuwen, st[1].math, st[1].english);
return 0;
}