2 条题解
-
1
#include <stdio.h> #include <malloc.h> int main() { int N,i,s,j; int* M=NULL; int* q=NULL; scanf("%d",&N); M=(int*)calloc(N,sizeof(int)); for(i=0;i<N;i++) { s=0; scanf("%d",&M[i]); q=(int*)calloc(M[i],sizeof(int)); for(j=0;j<M[i];j++) { scanf("%d",&q[j]); s+=q[j]; } free(q); printf("%d\n",s); } return 0; }
- 1
信息
- ID
- 316
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 4
- 标签
- (无)
- 递交数
- 150
- 已通过
- 72
- 上传者