加了#include<stdlib.h> #include <process.h>,system(pause);还是会报错,求指导
#include<stdio.h>#include<conio.h>
#include<stdlib.h>
#include <process.h>
//#include <iostream>
int main()
{
long a[10000];
long i,j=0;
for(i=0;i<10000;i++)
a[i]=0;
for(i=1;i<10000;i++)
{
if(i<=9)
a[i+i]=1;
if(i>9&&i<=99)
a[i+i/10+i%10]=1;
if(i>99&&i<=999)
a[i+i/100+i%100/10+i/100%10]=1;
/*if(i>99&&i<=999)
a[i+i/100+i/10+i%10]=1; */
if(i>999&&i<=9999)
a[i+i/1000+i%1000/100+i%1000%100/10+i%10]=1;
}
//输出自我数,每十个暂停
for(i=1;i<10000;i++)
{
if(a[i]==0)
{
printf("%ld\n",i);
j++;
}
if(j==10)
{
printf("按enter键继续输出\n");
/* getchar();*/
system(pause);
j=0;
}
}
return 0;
}
--------------------Configuration: ziwoshu - Win32 Debug--------------------
Compiling...
ziwoshu.c
F:\C-test\ziwoshu\ziwoshu.c(41) : error C2065: 'pause' : undeclared identifier
F:\C-test\ziwoshu\ziwoshu.c(41) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
F:\C-test\ziwoshu\ziwoshu.c(41) : warning C4024: 'system' : different types for formal and actual parameter 1
Error executing cl.exe.
ziwoshu.obj - 1 error(s), 2 warning(s)