A+B for Input-Output Practice (IV)

#include <stdio.h>
int main()
{
    int n, x, sum;
    while((scanf("%d",&n)!=EOF)&&(n!=0))
    {
        sum=0;
        while(n--)
        {
            scanf(" %d",&x);
            sum=sum+x;
        }
        printf("%d\n",sum);
    }
    return 0;
}

相关文章:

  • 2021-10-12
  • 2021-07-07
  • 2021-05-04
  • 2021-07-09
  • 2021-08-24
  • 2021-08-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案