题解 | #N个数之和#

N个数之和

https://www.nowcoder.com/practice/b007744eb43b4f7b95d9e87de01528db

#include <stdio.h>
int main() 
{
    int n,i,sum=0;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++)
    {
		scanf("%d",&a[i]);
		sum=sum+a[i];
	}
	printf("%d",sum);
	return 0;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务