Back to photostream

ScreenHunter_52 Aug. 21 09.54

github.com/FeetWetCoding/FeetWetCoding/blob/master/exerci...

 

// copyright (c) 2011 Robert Holder, Janice Dugger.

// See HELP.html included in this distribution.

 

#include

#include

 

// ==========================================

// = THIS IS THE SOLUTION CODE =

// = THIS IS *NOT* THE EXERCISE CODE =

// = (If you meant to look at the exercise =

// = it's in the directory above this one.) =

// ==========================================

 

void Primes1Soln::runExercise()

{

int n = 0, c = 0, x = 0, y = 0;

int horizontalstep = 30, verticalstep = 40;

bool prime = true;

Color color = DARKBLUE;

 

for ( n = 1; n < 101; n++ )

{

fwcInt(n, x, y, color);

 

for ( c = 2; c 400 - horizontalstep )

{

x = 0;

y += verticalstep;

}

}

fwcText("Every number in a red box is a prime number.", 20, 370, RED, 12);

seeout << "A prime number is divisible by 1, and itself, but\n";

seeout <>>none of the numbers in between!<<< (hint, hint! :-)\n";

}

191 views
0 faves
0 comments
Uploaded on August 21, 2012
Taken on August 21, 2012