#include
using namespace std;

bool akk(const int n)
sum=0;
{
if (n == 1)
return false;
for (int i=2; i<=n/2; ++i)
if (n % i == 0)
return false;
return true;
}
int main()
{
for (int i=1; i<=100; ++i)
if (akk(i))
cout << i << endl;
return 0;
}
программа выводит простые числа. Помогите их просуммировать
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.