F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_20612470_21295.cpp:6:25: error: stray '#' in program
     using namespace std;#define maxn 1000010bool prime[maxn];void Prime(){    memset(prime,true,sizeof(prime));    prime[0]=prime[1]=0;    for(int i=2;i*i<maxn;i++)        if(prime[i])            for(int j=2*i;j<maxn;j+=i)                prime[j]=0;}int main(){    Prime();    int n,ans,p;    while(scanf("%d",&n)!=EOF)    {        ans=0;        for(int i=1;;i++)        {            int tmp=3*i*i+3*i+1;            if(tmp>n)                break;            if(prime[tmp])                ans++;        }        if(ans)            printf("%d\n",ans);        else            printf("No Special Prime!\n");    }    return 0;}
                         ^
0_0_20612470_21295.cpp:6:26: error: 'define' does not name a type
     using namespace std;#define maxn 1000010bool prime[maxn];void Prime(){    memset(prime,true,sizeof(prime));    prime[0]=prime[1]=0;    for(int i=2;i*i<maxn;i++)        if(prime[i])            for(int j=2*i;j<maxn;j+=i)                prime[j]=0;}int main(){    Prime();    int n,ans,p;    while(scanf("%d",&n)!=EOF)    {        ans=0;        for(int i=1;;i++)        {            int tmp=3*i*i+3*i+1;            if(tmp>n)                break;            if(prime[tmp])                ans++;        }        if(ans)            printf("%d\n",ans);        else            printf("No Special Prime!\n");    }    return 0;}
                          ^
0_0_20612470_21295.cpp: In function 'void Prime()':
0_0_20612470_21295.cpp:6:86: error: 'prime' was not declared in this scope
     using namespace std;#define maxn 1000010bool prime[maxn];void Prime(){    memset(prime,true,sizeof(prime));    prime[0]=prime[1]=0;    for(int i=2;i*i<maxn;i++)        if(prime[i])            for(int j=2*i;j<maxn;j+=i)                prime[j]=0;}int main(){    Prime();    int n,ans,p;    while(scanf("%d",&n)!=EOF)    {        ans=0;        for(int i=1;;i++)        {            int tmp=3*i*i+3*i+1;            if(tmp>n)                break;            if(prime[tmp])                ans++;        }        if(ans)            printf("%d\n",ans);        else            printf("No Special Prime!\n");    }    return 0;}
                                                                                      ^
0_0_20612470_21295.cpp:6:156: error: 'maxn' was not declared in this scope
     using namespace std;#define maxn 1000010bool prime[maxn];void Prime(){    memset(prime,true,sizeof(prime));    prime[0]=prime[1]=0;    for(int i=2;i*i<maxn;i++)        if(prime[i])            for(int j=2*i;j<maxn;j+=i)                prime[j]=0;}int main(){    Prime();    int n,ans,p;    while(scanf("%d",&n)!=EOF)    {        ans=0;        for(int i=1;;i++)        {            int tmp=3*i*i+3*i+1;            if(tmp>n)                break;            if(prime[tmp])                ans++;        }        if(ans)            printf("%d\n",ans);        else            printf("No Special Prime!\n");    }    return 0;}
                                                                                                                                                            ^
0_0_20612470_21295.cpp: In function 'int main()':
0_0_20612470_21295.cpp:6:463: error: 'prime' was not declared in this scope
     using namespace std;#define maxn 1000010bool prime[maxn];void Prime(){    memset(prime,true,sizeof(prime));    prime[0]=prime[1]=0;    for(int i=2;i*i<maxn;i++)        if(prime[i])            for(int j=2*i;j<maxn;j+=i)                prime[j]=0;}int main(){    Prime();    int n,ans,p;    while(scanf("%d",&n)!=EOF)    {        ans=0;        for(int i=1;;i++)        {            int tmp=3*i*i+3*i+1;            if(tmp>n)                break;            if(prime[tmp])                ans++;        }        if(ans)            printf("%d\n",ans);        else            printf("No Special Prime!\n");    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 22:21:44, Gzip enabled