473,382 Members | 1,252 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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.
ro***********@si.htnet.hr
Jul 22 '05 #1
4 2971
* 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?
Jul 22 '05 #2
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.
ro***********@si.htnet.hr


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
Jul 22 '05 #3

sk6307 <sk****@btinternet.com> wrote in message
news:cd**********@titan.btinternet.com...
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.
ro***********@si.htnet.hr


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


IS THIS(1000-2000) lines of code !!!!!!!!!!!!!!!!!!!
Jul 22 '05 #4
"Robert Bralic" <ro***********@si.htnet.hr> wrote in message news:<cd**********@ls219.htnet.hr>...
[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 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: JS | last post by:
We have the same floating point intensive C++ program that runs on Windows on Intel chip and on Sun Solaris on SPARC chips. The program reads the exactly the same input files on the two platforms....
27
by: hokiegal99 | last post by:
Hi Guys, This is my first C program. I started programming in Python. Please look over this source and let me know if I'm doing anything wrong. I want to start out right with C, so if you see...
3
by: Crypto Loko | last post by:
Hello everyone, I was wondering if anyone should have any TC++ v3.0 / BC++ v3.1, or DJGPP v2.03 code for RSA implementation (or similar public-key scheme(s)) - of either a module, a library,...
2
by: BKMiller | last post by:
Hello everyone, I'm just getting started playing around with C++, so please don't laugh too loudly at my crude source code, okay? (o^^o) I'm combining together several introductory exercises...
17
by: Student | last post by:
Hi All, I have an assignment for my Programming language project to create a compiler that takes a C++ file as input and translate it into the C file. Here I have to take care of inheritance and...
27
by: Neil | last post by:
Hello all! I wrote program with a array of pointers, and I suspect they are pointing at each other in the Do ...While loop. Something is messed up with the increment variable word. A program...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
6
by: Bill Cunningham | last post by:
As I have been studing my tutorial I came up with this question. I took char passw(char name); and initialied this function in a header with other includes for standard library headers. This...
16
by: scholz.lothar | last post by:
I want to add some extension features to my program and this would require that i bundle a small c compiler with my program. On Unix it seems that tiny-c can do this, but i don't know about windows.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.