const S1_MAX=9876543210;
function find_And_Print_Solutions_For_N(var N){
var S2_MIN := 1;
var S2_MAX := S1_MAX / N;
var s1 := 0;
var s2 := 0;
LOOP -> for s2 = S2_MIN to S2_MAX do the following
{
1) if ( has_Repeated_Digits(s2) ) continue;
2) s1 := s2 * N;
3) if (s1 > S1_MAX ...
Search found 2 matches
- Mon Oct 12, 2009 5:55 pm
- Forum: Volume 4 (400-499)
- Topic: 471 - Magic Numbers
- Replies: 29
- Views: 15872
- Mon Oct 12, 2009 5:49 pm
- Forum: Volume 4 (400-499)
- Topic: 471 - Magic Numbers
- Replies: 29
- Views: 15872
Re: 471 compile error
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
#define S1_MAX 9876543210ULL
bool checkDigits(unsigned long long s1) {
string n_str = "";
ostringstream os;
os << s1;
n_str = os.str();
int dn[10] = {0};
for (int i = 0; i < n_str.length(); i++) {
if (dn[n_str ...
#include <string>
#include <sstream>
using namespace std;
#define S1_MAX 9876543210ULL
bool checkDigits(unsigned long long s1) {
string n_str = "";
ostringstream os;
os << s1;
n_str = os.str();
int dn[10] = {0};
for (int i = 0; i < n_str.length(); i++) {
if (dn[n_str ...