HDU 1094 A+B for Input-Output Practice (VI)

#include <cstdio>
int main()
{
  int n;
  while(scanf("%d",&n)!=EOF)
  {
    int x,ans;
    ans=0;
    for(int i=1; i<=n; i++) 
    {
      scanf("%d",&x);
      ans+=x;
    }
    printf("%d\n",ans);
  }
  return 0;
}

 

posted @ 2014-02-07 15:50  forever97  阅读(105)  评论(0编辑  收藏  举报