国家开放大学 / C语言程序设计
#include
#include
struct Worker {
char name[15]; //姓名
int age; //年龄
float pay; //工资
};
void main() {
struct Worker x;
char *t="liouting";
int d=38; float f=3493;
strcpy(x.name,t);
x.age=d; x.pay=f;
printf("%s %d %6.0f
",x.name,x.age,x.pay);
}
#include
struct Worker {
char name[15]; //姓名
int age; //年龄
float pay; //工资
};
void main() {
struct Worker x;
char *t="liouting";
int d=38; float f=3493;
strcpy(x.name,t);
x.age=d; x.pay=f;
printf("%s %d %6.0f
",x.name,x.age,x.pay);
}
参考答案: