stronger


私信TA

用户名:stronger

访问量:16678

签 名:

等  级
排  名 1902
经  验 2466
参赛次数 1
文章发表 22
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:


参考代码:

#include <stdio.h>

#include <stdlib.h>

struct student{

char id[20];

char name[20];

int a;

int b;

int c;

};




void  input(struct  student  *p){


  scanf("%s%s%d%d%d",p->id,p->name,&p->a,&p->b,&p->c);

}



void  output(struct  student  *p){

printf("%s,%s,%d,%d,%d\n",p->id,p->name,p->a,p->b,p->c);

}


int main()

{

//    cout << "Hello world!" << endl;

    struct  student buf[50],*p;

    int n;

    scanf("%d",&n);

    for(p=buf;p<buf+n;p++){

        input(p);

    }

     for(p=buf;p<buf+n;p++){

        output(p);

    }

    return 0;

}


 

0.0分

0 人评分

  评论区