TPHUNTERSCPP Telegram 146
🧠 #کد_چالش
حل توسط : خانم the lovely me
#include <iostream>

using namespace std;

int is_abundant(int n)
{
int sum = 0;

for (int i = 1; i < n; i++)
if (n % i == 0)
sum += i;

if (sum > n)
return sum - n;
else
return 0;
}

int main()
{
int n;
cin >> n;

for (int i = 12; i <= n; i++)
if (is_abundant(i))
cout << i << " - abundance: " << is_abundant(i) << endl;

return 0;
}

🟢لطفا سوالات, نظرات و کد های خود را برای ما کامنت کنید



tgoop.com/tphunterscpp/146
Create:
Last Update:

🧠 #کد_چالش
حل توسط : خانم the lovely me

#include <iostream>

using namespace std;

int is_abundant(int n)
{
int sum = 0;

for (int i = 1; i < n; i++)
if (n % i == 0)
sum += i;

if (sum > n)
return sum - n;
else
return 0;
}

int main()
{
int n;
cin >> n;

for (int i = 12; i <= n; i++)
if (is_abundant(i))
cout << i << " - abundance: " << is_abundant(i) << endl;

return 0;
}

🟢لطفا سوالات, نظرات و کد های خود را برای ما کامنت کنید

BY Tp hunters cpp


Share with your friend now:
tgoop.com/tphunterscpp/146

View MORE
Open in Telegram


Telegram News

Date: |

1What is Telegram Channels? Developing social channels based on exchanging a single message isn’t exactly new, of course. Back in 2014, the “Yo” app was launched with the sole purpose of enabling users to send each other the greeting “Yo.” How to Create a Private or Public Channel on Telegram? Hashtags Administrators
from us


Telegram Tp hunters cpp
FROM American