就是杨辉三角那道题,结果运行出来没问题,时间内存也都正确,但为啥是0分呢
#include<stdio.h>
int main()
{
int listd[100][100], list[5050];
int i, j, k,h,number;
k = 0;
h = 0;
for (i = 0; i < 100; i++)
{
listd[i][i] = 1;
listd[i][0] = 1;
}
for (i = 2; i < 100; i++)
{
for (j = 1; j < i; j++)
listd[i][j] = listd[i - 1][j - 1] + listd[i - 1][j];
}
for (i = 0; i < 100; i++)
{
for (j = 0; j < i+1; j++)
{
list[k]=listd[i][j];
k++;
}
}
scanf("%d",&number);
while (list[h] != number)
{
h++;
}
printf("%d", h + 1);
}