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_16379217_24023.cpp:5:12: error: stray '#' in program
 int main(){#ifndef ONLINE_JUDGE    //freopen("testin.txt","r",stdin);#endif    int n,i,s,a,p;    fun();    while(scanf("%d",&n)!=EOF && n)    {        while(n++)        {            if(Judge(n))  //���������������continue             continue;         s=0;p=n;         for(i=2;i*i<=p;i++)         {          if(p%i==0)          {           p/=i;           a=sum(i);           s+=a;           while(p%i==0)           {            p/=i;            s+=a;           }          }         }         if(p>1)          s+=sum(p);            if(sum(n)==s)            {                printf("%d\n",n);                break;            }        }    }    return 0;}
            ^
0_0_16379217_24023.cpp: In function 'bool Judge(int)':
0_0_16379217_24023.cpp:4:15: error: a function-definition is not allowed here before '{' token
 int sum(int a){ //�����ĸ���λ֮��    int s;    s=0;    while(a)    {        s+=a%10;        a/=10;    }    return s;}
               ^
<command-line>:0:14: error: expected '}' at end of input
0_0_16379217_24023.cpp:5:20: note: in expansion of macro 'ONLINE_JUDGE'
 int main(){#ifndef ONLINE_JUDGE    //freopen("testin.txt","r",stdin);#endif    int n,i,s,a,p;    fun();    while(scanf("%d",&n)!=EOF && n)    {        while(n++)        {            if(Judge(n))  //���������������continue             continue;         s=0;p=n;         for(i=2;i*i<=p;i++)         {          if(p%i==0)          {           p/=i;           a=sum(i);           s+=a;           while(p%i==0)           {            p/=i;            s+=a;           }          }         }         if(p>1)          s+=sum(p);            if(sum(n)==s)            {                printf("%d\n",n);                break;            }        }    }    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-12-04 18:31:31, Gzip enabled