Any small program in c++ compilable with gnu gpp compiler

Discussion in 'C++' started by Robert Bralic, Jul 19, 2004.

  1. Hi,

    Can anybody send to me aby small c++ program that is
    compilable vith gpp under Linux ,that I can belive that C++
    realy exists ,(1000-2000) lines program source.


    Robert Bralic, Jul 19, 2004
    #1
    1. Advertising

  2. * Robert Bralic:
    >
    > Can anybody send to me aby small c++ program that is
    > compilable vith gpp under Linux ,that I can belive that C++
    > realy exists ,(1000-2000) lines program source.


    #include <iostream>
    int main()
    {
    for( unsigned i = 0; i < 10000; ++i )
    {
    std::cout << "Do my assignment for me" << std::endl;
    }
    }

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
    Alf P. Steinbach, Jul 19, 2004
    #2
    1. Advertising

  3. Robert Bralic

    sk6307 Guest

    Robert Bralic wrote:
    > Hi,
    >
    > Can anybody send to me aby small c++ program that is
    > compilable vith gpp under Linux ,that I can belive that C++
    > realy exists ,(1000-2000) lines program source.
    >
    >
    >
    >
    >


    No problem, here you go:

    #include <iostream>
    using namespace std;
    #define s string
    #define i int
    #define v void
    #define c cout
    #define in inline
    #define t template
    #define S(num, s) t<>struct pre<true, num>{static v print(){c<<s;}};
    #define O(ones, s) t<>in v p<ones>(){c<<s;}
    #define T(tens, s) t<>in v print_tens<tens>(){c<<s;}
    t<bool small,i I>struct pre;t<i ones>in v p();t<i tens>in v
    print_tens();S(0,"No")S(1,"One")S(2,"Two")S(3,"Three")S(4,"Four")
    S(5,"Five")S(6,"Six")S(7,"Seven")S(8,"Eight")S(9,"Nine")S(10,"Ten")
    S(11,"Eleven")S(12,"Twelve")S(13,"Thirteen")S(14,"Fourteen")S(15,
    "Fifteen")S(16,"Sixteen")S(17,"Seventeen")S(18,"Eighteen")S(19,
    "Nineteen")O(0," ")O(1," one")O(2," two")O(3," three")O(4," four")
    O(5," five")O(6," six")O(7," seven")O(8," eight")O(9," nine")T(2,
    "Twenty")T(3,"Thirty")T(4,"Forty")T(5,"Fifty")T(6,"Sixty")T(7,
    "Seventy")T(8,"Eighty")T(9,"Ninety")t<i I>struct pre<false,I>{
    static v print(){print_tens<(I-I%10)/10>();p<(I%10)>();}};t<i I>
    v pr(){pre<(I<20),I>::print();} t<i I>in v B(){pr<I>();c<<" bottles \
    of beer";}t<>in v B<1>(){pr<1>();c<<" bottle of beer";}t<i I>in
    v Bo(){B<I>();c << " on the wall";}t<i I>in v stanza(){Bo<I>();c<<
    ",\n";B<I>();c<<",\n";}t<i I>in v bridge(){c<<"Take one down, pass \
    it around,"<<endl;Bo<I-1>();c<<",\n";}t<>in v bridge<0>(){c<<"Go to \
    the store and buy some more,"<<endl;Bo<99>();}t<i I>in v verse(){
    stanza<I>();bridge<I>();}t<i I>in v sing(){verse<I>();c<<endl;sing<I
    -1>();}t<>in v sing<0>(){verse<0>();}i main(){sing<99>();}

    I hope it helps :)

    sk
    sk6307, Jul 19, 2004
    #3
  4. sk6307 <> wrote in message
    news:cdf6ri$kks$...
    > Robert Bralic wrote:
    > > Hi,
    > >
    > > Can anybody send to me aby small c++ program that is
    > > compilable vith gpp under Linux ,that I can belive that C++
    > > realy exists ,(1000-2000) lines program source.
    > >
    > >
    > >
    > >
    > >

    >
    > No problem, here you go:
    >
    > #include <iostream>
    > using namespace std;
    > #define s string
    > #define i int
    > #define v void
    > #define c cout
    > #define in inline
    > #define t template
    > #define S(num, s) t<>struct pre<true, num>{static v print(){c<<s;}};
    > #define O(ones, s) t<>in v p<ones>(){c<<s;}
    > #define T(tens, s) t<>in v print_tens<tens>(){c<<s;}
    > t<bool small,i I>struct pre;t<i ones>in v p();t<i tens>in v
    > print_tens();S(0,"No")S(1,"One")S(2,"Two")S(3,"Three")S(4,"Four")
    > S(5,"Five")S(6,"Six")S(7,"Seven")S(8,"Eight")S(9,"Nine")S(10,"Ten")
    > S(11,"Eleven")S(12,"Twelve")S(13,"Thirteen")S(14,"Fourteen")S(15,
    > "Fifteen")S(16,"Sixteen")S(17,"Seventeen")S(18,"Eighteen")S(19,
    > "Nineteen")O(0," ")O(1," one")O(2," two")O(3," three")O(4," four")
    > O(5," five")O(6," six")O(7," seven")O(8," eight")O(9," nine")T(2,
    > "Twenty")T(3,"Thirty")T(4,"Forty")T(5,"Fifty")T(6,"Sixty")T(7,
    > "Seventy")T(8,"Eighty")T(9,"Ninety")t<i I>struct pre<false,I>{
    > static v print(){print_tens<(I-I%10)/10>();p<(I%10)>();}};t<i I>
    > v pr(){pre<(I<20),I>::print();} t<i I>in v B(){pr<I>();c<<" bottles \
    > of beer";}t<>in v B<1>(){pr<1>();c<<" bottle of beer";}t<i I>in
    > v Bo(){B<I>();c << " on the wall";}t<i I>in v stanza(){Bo<I>();c<<
    > ",\n";B<I>();c<<",\n";}t<i I>in v bridge(){c<<"Take one down, pass \
    > it around,"<<endl;Bo<I-1>();c<<",\n";}t<>in v bridge<0>(){c<<"Go to \
    > the store and buy some more,"<<endl;Bo<99>();}t<i I>in v verse(){
    > stanza<I>();bridge<I>();}t<i I>in v sing(){verse<I>();c<<endl;sing<I
    > -1>();}t<>in v sing<0>(){verse<0>();}i main(){sing<99>();}
    >
    > I hope it helps :)
    >
    > sk


    IS THIS(1000-2000) lines of code !!!!!!!!!!!!!!!!!!!
    Robert Bralic, Jul 19, 2004
    #4
  5. Robert Bralic

    Guest

    "Robert Bralic" <> wrote in message news:<cdggqf$897$>...
    [happy song code example snipped]
    > IS THIS(1000-2000) lines of code !!!!!!!!!!!!!!!!!!!


    99 request to do my homework on the group
    99 request to do my homework.
    Download one request
    Deride it with glee.
    98 requests to do my homework on the group.


    Hey Bob. Read the FAQ.
    Socks
    , Jul 19, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. valentin tihomirov

    Should this substitution be compilable?

    valentin tihomirov, Nov 28, 2004, in forum: VHDL
    Replies:
    12
    Views:
    779
    valentin tihomirov
    Nov 30, 2004
  2. VisionSet
    Replies:
    3
    Views:
    2,025
    Andrew Thompson
    Sep 2, 2004
  3. Markus Elfring
    Replies:
    2
    Views:
    358
    Markus Elfring
    Feb 23, 2005
  4. Crypto Loko
    Replies:
    3
    Views:
    300
    Crypto Loko
    Oct 16, 2005
  5. bookaa bookaa
    Replies:
    12
    Views:
    76
    Steven D'Aprano
    May 27, 2014
Loading...

Share This Page