|
|
刚开始学C++,听朋友建议先从Turbo C++开始,一些基本语句已经掌握,但是实际编的时候总报错是怎么回事啊?
我想编一个判断质数的程序,它老是报错:
Linker Error: Undefined symbol N_FTOL@ in module NEW1.cpp
Linker Error: Undefined symbol N_LMOD@ in module NEW1.cpp
这是怎么回事啊?
我的代码:
#include <stdio.h>
#include <math.h>
int Judge1(long n1);
void main()
{
long Inp1;
printf("Input a Number:");
scanf("%d",Inp1);
printf("%d",Judge1(Inp1));
}
int Judge1(long n1)
{
long s1;
int flag1=1;
if (n1==2) {return flag1;}
for (s1=2;s1>=(long)(sqrt(n1));s1++)
{
if ((n1 % s1)==0) {flag1=0;break;}
}
return flag1;
}
|
|