大家可以帮我看看这段代码么,一直显示未定义标识符’a',‘t',是哪里出了问题?
#include<stdio.h>#define N 3
int fun(int t, int sum)
{
int i, j;
for (i = 0; i < N; i++)
{
for (j = 0; j <= i; j++)
sum +=a;
}
return sum;
}
void main()
{
int a = { 1,2,3,4,5,6,7,8,9 }, sum = 0;
sum = fun( t, 0);
printf("%d", sum); #include<stdio.h>
#define N 3
int fun(int t, int sum)
{
int i, j;
for (i = 0; i < N; i++)
{
for (j = 0; j <= i; j++)
sum +=t;
}
return sum;
}
int main()
{
int a = { 1,2,3,4,5,6,7,8,9 }, sum = 0;
sum = fun(a, 0);
printf("%d", sum);
} pupil337 发表于 2020-5-7 22:52
#include
#define N 3
int fun(int t, int sum)
哇,谢谢 我想知道我在编程的时候打{}这个符号为啥永远不行 就好奇了
页:
[1]