Skip to content

曾覃朗 超级素数#1

Open
M-Kylie wants to merge 97 commits into
M-Kylie:masterfrom
Dashark:master
Open

曾覃朗 超级素数#1
M-Kylie wants to merge 97 commits into
M-Kylie:masterfrom
Dashark:master

Conversation

@M-Kylie

@M-Kylie M-Kylie commented Mar 31, 2021

Copy link
Copy Markdown
Owner

#include
int main()
{
int a,b,c;
int k=0,sum=0,max=2;
for(int i=100;i<1000;i++)
{
int f=1;
for(int j=2;j<i;j++)
{
if(i%j!=0)
continue;
else
{
f=-1;
break;
}
}
a=i/100;
b=(i/10)%10;
c=i%10;
for(int j=2;j<a+b+c;j++)
{
if((a+b+c)%j!=0)
continue;
else
{
f=-1;
break;
}
}
if(abc!=0)
{
for(int j=2;j<abc;j++)
{
if((abc)%j!=0)
continue;
else
{
f=-1;
break;
}
}
}
if(abc==0)
f=-1;
for(int j=2;j<aa+bb+cc;j++)
{
if((a
a+bb+cc)%j!=0)
continue;
else
{
f=-1;
break;
}
}
if(f==1)
{
k++;
sum+=i;
max=i>max?i:max;
}
}
std::cout<<"超级素数的个数为"<<k<<std::endl;
std::cout<<"所有超级素数之和为" <<sum<<std::endl;
std::cout<<"最大的超级素数为"<<max<<std::endl;
return 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants