哪位高手帮忙看一下,编译没问题。运行不出来。
只求看一下是那个地方错了,而不是要一个对的,请高手帮忙!
代码如下:
#include "stdafx.h"
#include"stdio.h"
int he(int a[99],int n)
{ int m;
int *p,i=0;
p=a;
for (p=a;p<a+n;p++)
{
printf("input a[%d]:\n",i++);
scanf("%d\n",p);
}
i=0;
p=a;
m=a[0];
for (p=a;p<a+n;p++)
{
m=m+a;
}
return m;
}
void main ()
{
int n,a[99],m;
printf("input the size of the shuzu what can't be larger then 100\n");
scanf("%d",&n);
m=he(a,n);
printf("the he of what you input is:%d\n",m);
}
另外,调试信息如下:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
The thread 0x9A24 has exited with code 32 (0x20).
The program 'C:\Program Files\Microsoft Visual Studio\MyProjects\zhizhen2\Debug\zhizhen2.exe' has exited with code 32 (0x20).
谢谢!
|