#include <cmath>
#include <iostream>
using namespace std;
void print_multiplications(int n) {
bool first = true;
for (int i = 2; i <= sqrt(n); ++i) {
if (n % i == 0) {
if (!first) cout << ", ";
cout << "<" << i << ", " << n / i << ">";
first = false;
}
}
cout << endl;
}
int main() {
int n = 0;
do {
cout << "Input a number between 10 and 80: ";
cin >> n;
} while (n < 10 || n > 80);
print_multiplications(n);
}
Comments
Leave a comment