9.
#include <iostream>
using namespace std;
int main()
{
int a, b, suma=0, sumb=0, i;
cin >> a >> b;
for (i = 1; i <= a; i++) {
if (a % i == 0) suma += i;
}
for (i = 1; i <= b; i++) {
if (b % i == 0) sumb += i;
}
if (suma == a && sumb == b) cout << "\nNumerele sunt prietene.";
else cout << "\nNu";
}
10.
#include "pch.h"
#include <iostream>
using namespace std;
int main()
{
int m = 3, n = 3, i, j;
for (i = 0; i < m; i++) {
for (j = 0; j < n; j++) {
cout << (n - i)*(m - j)<<"\t";
}
cout << endl;
}
}