I hereby claim:
- I am helixspiral on github.
- I am shawn (https://keybase.io/shawn) on keybase.
- I have a public key ASDTH57Dxc__WY96zkYSWwuMhVpMc8_L-qY9HsJOpynn5go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env ruby | |
| # Author: Shawn Smith | |
| # Purpose: Do nins math work | |
| # Problem: How many integers between 1500 and 8000 (inclusive) contain no repeated digits? | |
| total = 0 | |
| for x in 1500..8000 do | |
| number = x.to_s |
| # Copyright (c) 2013 Shawn Smith <[email protected]> | |
| # | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation; either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| #include <iostream> // Needed for std::cin/cout | |
| #include <vector> // Needed for std::vector | |
| #include <cmath> // Needed for sqrt and ceil | |
| int main() | |
| { | |
| /* Will be the sieve */ | |
| std::vector<bool> Sieve; | |
| unsigned int x, y, limit; |
| #include <iostream> // Needed for std::cout/cin | |
| #include <vector> // Needed for std::vector | |
| #include <string> // Needed for std::string | |
| #include <algorithm> // Needed for std::sort | |
| int main() | |
| { | |
| std::string user_input; | |
| std::vector<int> digits; | |
| bool negative; |
| # Enter the encoded password from HackThisSite | |
| encoded_password = "a9;96j6i" | |
| # empty string for the decoded password | |
| password = "" | |
| # Loop for the length of the encoded password | |
| 0.upto(encoded_password.length-1) do |x| | |
| password += ((encoded_password[x].ord)-x).chr | |
| end |
| #include <iostream> | |
| #include <cmath> | |
| #include "Prime.h" | |
| int main() | |
| { | |
| int x; | |
| bool Failure = false; | |
| for (x = 1; Failure != true; ++x) |
| /** Write a program that prompts the user for a positive | |
| * integer and then computes the sum of all the digits of | |
| * the number. For example, if the user enters 2784, | |
| * then the program reports 21. If the user enters 59, | |
| * then the program reports 14. The program should work | |
| * for any number having one to ten digits. | |
| */ | |
| #include <iostream> | |
| #include <string> |
| /** Write a program that prompts the user for a positive integer | |
| * and then reports the closest integer having a whole number square root. | |
| * For example if the user enters 8 then the program reports 9. | |
| * The program should work for any number having one to seven digits. | |
| */ | |
| #include <stdio.h> | |
| /* Checks to see if the number is a perfect square. | |
| returns 1 for yes, 0 for no. */ |
| /* http://rosettacode.org/wiki/99_Bottles_of_Beer */ | |
| #include <stdio.h> | |
| int main() | |
| { | |
| int bottles; | |
| for(bottles = 99; bottles > 0; --bottles) | |
| { |