Created
August 17, 2021 07:19
-
-
Save modos/196cac1d2e69d24c53a7382e6b574984 to your computer and use it in GitHub Desktop.
مقسوم علیه های دردسر ساز
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int n; | |
int sum = 0; | |
int count = 0; | |
cin >> n; | |
for (int i = 1; i <= n; i++) { | |
for (int j=1;j<=i;j++){ | |
if (i%j==0) { | |
sum+= j; | |
count++; | |
} | |
} | |
} | |
cout << count << " " << sum; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment