迟迟


私信TA

用户名:chichi1

访问量:1132

签 名:

等  级
排  名 707
经  验 3773
参赛次数 0
文章发表 10
年  龄 0
在职情况 学生
学  校 邢台学院
专  业

  自我简介:

TA的其他文章

城市交通路网c++
浏览:198

解题思路:

注意事项:

参考代码:

#include<stdio.h>

struct student{

char sno[100];

char name[100];

int gread[3];

};

void input(struct student* stu,int n)

{

int i,j=0;

for(i=0;i<n;i++)

{

scanf("%s%s%",&stu[i].sno,&stu[i].name);

for(j=0;j<3;j++)

{

scanf("%d",&stu[i].gread[j]);

}

}

}

void print(struct student* stu,int n)

{

int i,j;

for(i=0;i<n;i++)

{

printf("%s,%s",stu[i].sno,stu[i].name);

for(j=0;j<3;j++)

{

printf(",%d",stu[i].gread[j]);

}

printf("\n");

}

}

void main()

{

int n;

scanf("%d",&n);

struct student stu[n];

input(stu,n);

print(stu,n);

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区