Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Started work on 12

  • Loading branch information...
commit 6f501d43a8303bb6cc908fa3348ae3aaf9e996ff 1 parent ce10996
Nathan Broadbent authored
Showing with 61 additions and 0 deletions.
  1. +44 −0 12/solution.c
  2. +17 −0 12/solution.rb
44 12/solution.c
View
@@ -0,0 +1,44 @@
+#include <iostream>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string>
+#include <math.h>
+using namespace std;
+
+
+int number_of_factors(unsigned long long * n) {
+ // Store factors in an array.
+ unsigned long factors[500] = {0};
+
+ // No number has factors greater than the sqrt of itself.
+ unsigned long max = unsigned long (sqrt ((long double)*n));
+
+ unsigned long test = ;
+ while (test < max) {
+ if (*n % *test == 0) {
+
+ } else {
+
+ };
+
+ printf ("x = %d\n", x);
+ x++;
+ }
+
+
+
+ for (int i=3; i <= max; i+=2) {
+ if (*n % i == 0)
+ return(false);
+ }
+ return(true);
+}
+
+
+int main (int argc, char *argv[])
+{
+
+
+ return(0);
+}
+
17 12/solution.rb
View
@@ -0,0 +1,17 @@
+#!/usr/bin/env ruby
+# coding: utf-8
+# -----------------------------------------
+# | A solution to a Project Euler problem |
+# -----------------------------------------
+require 'rubygems'
+require 'pp'
+problem_no = File.dirname(File.expand_path(__FILE__)).split('/').last
+puts "=== Solving Project Euler problem ##{problem_no}\n\n"
+question = %Q{
+
+
+
+}
+puts "? #{question.strip}\n\n"
+# --------------------------------------------------------------------
+
Please sign in to comment.
Something went wrong with that request. Please try again.