求助!!关于求素数。看不懂怎么错的
#include <stdio.h>#include "math.h"
#define N 101
main()
{
int i,j,line,a[N];
for(i=2;i<N;i++) a[i]=i;
for(i=2;i<sqrt(N);i++)
for(j=i+1;j<N;j++)
{
if(a[i]!=0&&a[j]!=0)
if(a[j]%a[i]==0)
a[j]=0;}
printf("\n");
for(i=2,line=0;i<N;i++)
{
if(a[i]!=0)
{printf("%5d",a[i]);
line++;}
if(line==10)
{printf("\n");
line=0;}
}
}
--------------------Configuration: s - Win32 Debug--------------------
Compiling...
s.cpp
E:\学习\w\s.cpp(17) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(17) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(19) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(19) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(21) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(21) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(21) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(21) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(23) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(23) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(23) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(23) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(25) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(25) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(25) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(25) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(33) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(33) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(35) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(35) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(37) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(37) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(39) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(39) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(41) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(41) : error C2018: unknown character '0xa1'
E:\学习\w\s.cpp(47) : warning C4508: 'main' : function should return a value; 'void' return type assumed