aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk3/lab3/primeFactor.cpp
blob: 1ec5bccc67bce1fcdc86f8474ce6952e55a805bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int primefinder (long long n) {
  for (long long i=n; i>1; --i) {

      if (n%i==0 && n!=i) {
        primefinder(i);
        cout << i << "*";
      }
    }
    return composite;
}
int main () {
  long long n;
  cout << "Input a positive integer:  ";
  cin >> n;
  primefinder(n);
  cout << endl;
}