问题补充说明:高手帮下忙啊
sumprime=0;
n=1;
whilen<=100
ifisprime(360问答n)
sumprime=sumprime+n;
end
n=n+1;
end
sumprime
如果不用循环的话,可以:
n=1:1贵陆业然问江00;
sum(n(isprime(n)))
问题补充说明:高手帮下忙啊
sumprime=0;
n=1;
whilen<=100
ifisprime(360问答n)
sumprime=sumprime+n;
end
n=n+1;
end
sumprime
如果不用循环的话,可以:
n=1:1贵陆业然问江00;
sum(n(isprime(n)))
扫一扫,手机浏览