Skip to content

Instantly share code, notes, and snippets.

@modos
Created August 17, 2021 07:19
Show Gist options
  • Save modos/196cac1d2e69d24c53a7382e6b574984 to your computer and use it in GitHub Desktop.
Save modos/196cac1d2e69d24c53a7382e6b574984 to your computer and use it in GitHub Desktop.
مقسوم علیه های دردسر ساز
#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