C语言详细解答步骤
#include<stdio.h>intsum(int*p,intn){ints=0,j;for(j=0;j<n;j++)s+=p[j];returns;}intmain...
#include <stdio.h>
int sum (int *p,int n)
{int s=0,j;
for (j=0;j<n;j++)
s+=p[j];
return s;
}
int main()
{
int a[] = {1,2,3,4,5,6,7,8,9,10},t;
t=sum (a+2, 5);
printf ("%d",t);
return 0;
} 展开
int sum (int *p,int n)
{int s=0,j;
for (j=0;j<n;j++)
s+=p[j];
return s;
}
int main()
{
int a[] = {1,2,3,4,5,6,7,8,9,10},t;
t=sum (a+2, 5);
printf ("%d",t);
return 0;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询