HDU 1093 A+B for Input-Output Practice (V)

#include <cstdio>
int main()
{
  int n,m,ans,x;
  scanf("%d",&m);
  for(int i=1; i<=m; i++)
  {
    ans=0;
    scanf("%d",&n);
    for(int j=1; j<=n; j++)
    { 
      scanf("%d",&x);
      ans+=x;
    }
    printf("%d
",ans);
  }
  return 0;
}
原文地址:https://www.cnblogs.com/forever97/p/3539612.html