发票统计者 V1.1


#include<stdio.h>
void printfCountAndSum(int,int);
int main(){
    int a[200];

    int count = 0; 
    int money;
    int totalCount = 0;
    while(scanf("%d",&money)!=EOF) 
    {
	a[count++]= money;
	totalCount += money;
	printfCountAndSum(count, totalCount);
    }

    printf("result:count=%d, sum=%d\n",count, totalCount);
    return 0;
}

void printfCountAndSum(int count,int sum) {
    printf("count:%d, sum:%d\n",count,sum);
}

Yeah,我我好有童心啊,说真的,估计大一的时候这种程度的程序都算很简单的那一类了,但是真的,不知道为什么,当看到自己开发的东西能解决自己实际上的问题,竟然是这么的开心.

发布了298 篇原创文章 · 获赞 25 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/qq_31433709/article/details/103803756