diff options
author | Matthew Strapp <msattr@gmail.com> | 2019-02-21 08:56:55 -0600 |
---|---|---|
committer | Matthew Strapp <msattr@gmail.com> | 2019-02-21 08:56:55 -0600 |
commit | 2b81e1c3095b8177b726c5a00b94af1270c3efe0 (patch) | |
tree | 7e265248c616da60b9080092b6e8204156da29ba /ee1301/wk3/lab3/primeFactor.cpp | |
parent | Finish Lab 3 (diff) | |
download | homework-2b81e1c3095b8177b726c5a00b94af1270c3efe0.tar homework-2b81e1c3095b8177b726c5a00b94af1270c3efe0.tar.gz homework-2b81e1c3095b8177b726c5a00b94af1270c3efe0.tar.bz2 homework-2b81e1c3095b8177b726c5a00b94af1270c3efe0.tar.lz homework-2b81e1c3095b8177b726c5a00b94af1270c3efe0.tar.xz homework-2b81e1c3095b8177b726c5a00b94af1270c3efe0.tar.zst homework-2b81e1c3095b8177b726c5a00b94af1270c3efe0.zip |
Forget to commit things
Diffstat (limited to 'ee1301/wk3/lab3/primeFactor.cpp')
-rw-r--r-- | ee1301/wk3/lab3/primeFactor.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ee1301/wk3/lab3/primeFactor.cpp b/ee1301/wk3/lab3/primeFactor.cpp new file mode 100644 index 0000000..1ec5bcc --- /dev/null +++ b/ee1301/wk3/lab3/primeFactor.cpp @@ -0,0 +1,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; +} |