View Code of Problem 112

#include<stdio.h>
#include<stdbool.h>
int main() {
int a;

int b;
while((scanf("%d",&a))!=EOF){
       int sum=0;
    for(int x=0;x<a;x++){
        scanf("%d",&b);
        sum+=b;
    }
    if(a!=0)
        printf("%d\n",sum);
    else
        break;
}



	return 0;
}


Double click to view unformatted code.


Back to problem 112