aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk3/lab3/primeFactor.cpp
diff options
context:
space:
mode:
authorMatthew Strapp <msattr@gmail.com>2019-02-21 08:56:55 -0600
committerMatthew Strapp <msattr@gmail.com>2019-02-21 08:56:55 -0600
commit2b81e1c3095b8177b726c5a00b94af1270c3efe0 (patch)
tree7e265248c616da60b9080092b6e8204156da29ba /ee1301/wk3/lab3/primeFactor.cpp
parentFinish Lab 3 (diff)
downloadhomework-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.cpp21
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;
+}