题解 | N个数之和

N个数之和

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

#include <stdio.h>

int main() {
    int N;
    scanf("%d",&N);
    int num[N-1];
    int total = 0;
    for(int i = 0;i<N;i++){
    
        scanf("%d",&num[i]);
    }
    for(int i = 0;i<N;i++){
total += num[i];
    }
    
    printf("%d",total);
    return 0;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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