Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

FizzBuzz general

Name: Anonymous 2011-05-05 1:26

ITT: we show our implementations of FizzBuzz.

http://en.wikipedia.org/wiki/Bizz_buzz

package fizzbuzz;
public class Main {
public static void main(String[] args) {
int FIVE = 5;
int THREE = 3;
for (int i = 1; i < 101; i++) {
if ( (i % 5 == 0) && (i % 3 == 0) {
System.out.println("Fizz Buzz, ")
} else if (i % 5 == 0) {
System.out.println("Buzz, ")
} else if (i % 3 == 0) {
System.out.println("Fizz, ")
} else {
System.out.println(i + ", ");
}
}
}
}

Name: Anonymous 2011-05-05 5:51

Enjoy your AIDS, >>1
You're all welcome to admire this work of art.


#include <cstdlib>
#include <iostream>
using namespace std;

int main( int argc, char *argv[] ) {
    if( argc != 2 ) {
        cout << "usage: " << argv[0] << " <max>" << endl;
        return EXIT_SUCCESS;
    }

    long int max = atol(argv[1]);

    for( long int i = 0; i < max; i++ ) {
        if( i % 3 == 0 )
            cout << "Bizz";

        if( i % 3 == 0 and i % 5 == 0 )
            cout << " ";

        if( i % 5 == 0 )
            cout << "Buzz";

        if( i % 3 != 0 and i % 5 != 0 )
            cout << i;

        cout << endl;
    }

    return EXIT_SUCCESS;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List