Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 22nd, 2005, 04:37 PM
Robert Bralic
Guest
 
Posts: n/a
Default Any small program in c++ compilable with gnu gpp compiler

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@si.htnet.hr



  #2  
Old July 22nd, 2005, 04:37 PM
Alf P. Steinbach
Guest
 
Posts: n/a
Default Re: Any small program in c++ compilable with gnu gpp compiler

* Robert Bralic:[color=blue]
>
> 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.[/color]

#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?
  #3  
Old July 22nd, 2005, 04:37 PM
sk6307
Guest
 
Posts: n/a
Default Re: Any small program in c++ compilable with gnu gpp compiler

Robert Bralic wrote:[color=blue]
> 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@si.htnet.hr
>
>[/color]

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,"Thr ee")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,"Ei ghteen")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
  #4  
Old July 22nd, 2005, 04:38 PM
Robert Bralic
Guest
 
Posts: n/a
Default Re: Any small program in c++ compilable with gnu gpp compiler


sk6307 <sk6307@btinternet.com> wrote in message
news:cdf6ri$kks$1@titan.btinternet.com...[color=blue]
> Robert Bralic wrote:[color=green]
> > 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@si.htnet.hr
> >
> >[/color]
>
> 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,"Thr ee")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,"Ei ghteen")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[/color]

IS THIS(1000-2000) lines of code !!!!!!!!!!!!!!!!!!!


  #5  
Old July 22nd, 2005, 04:39 PM
puppet_sock@hotmail.com
Guest
 
Posts: n/a
Default Re: Any small program in c++ compilable with gnu gpp compiler

"Robert Bralic" <robert.bralic@si.htnet.hr> wrote in message news:<cdggqf$897$1@ls219.htnet.hr>...
[happy song code example snipped][color=blue]
> IS THIS(1000-2000) lines of code !!!!!!!!!!!!!!!!!!![/color]

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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.