标题:求大佬解答
只看楼主
df1823273864
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2016-12-14
结帖率:50%
已结贴  问题点数:20 回复次数:2 
求大佬解答
# define N 10
#include<stdio.h>
typedef chardatatype

 int main()
{
    typedef struct student
    {
    datatype  name [N];
    int   score[N],i,sum;
    }stu1;
    stu1={"fh"};
    for(i=0;i<N;i++){
    scanf("%d",&stu1.score[i]);
    sum+=stu1.score[i];}
    printf("the score of fh is %d",sum);
    return 0;
}
   
                    
   
2016-12-14 11:18
grmmylbs
Rank: 14Rank: 14Rank: 14Rank: 14
等 级:贵宾
威 望:54
帖 子:1409
专家分:5845
注 册:2016-2-14
得分:13 
程序代码:
# define N 10
#include<stdio.h>
typedef char datatype;

int main()
{
    typedef struct student
    {
        datatype  name[N];
        int   score[N];
    }stu1;
    int i, sum = 0;
    stu1 ststu = { "fh" };
    for (i = 0; i<N; i++) {
        scanf("%d", &ststu.score[i]);
        sum += ststu.score[i];
    }
    printf("the score of fh is %d", sum);
    return 0;
}
2016-12-14 11:29
艾瑞克
Rank: 3Rank: 3
来 自:贵州
等 级:论坛游侠
帖 子:100
专家分:105
注 册:2016-11-8
得分:7 
写程序要写注释
2016-12-14 13:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-472385-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.651602 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved