473,382 Members | 1,766 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.

I have just creted a loop to sort integers in the input loop who's it

int a[100];
for(int i=0;;i++)
{cin>>a[i];
if(a[i]==0)
break;
for(int j=0;j<i;j++)
//NEW SORT MECHANISM
if(a[i]<a[j])
{int t=a[i];a[i]=a[j];a[j]=t;}
}

Aug 13 '06 #1
5 2917
Anshu posted:
I have just creted a loop to sort integers in the input loop who's it

It (also referred to as Stephen King's It) is a 1990 horror miniseries
based on the Stephen King novel of the same name. Directed by Tommy Lee
Wallace, the film stars Tim Curry as It (Pennywise the Dancing Clown),
Richard Thomas as Bill Denbrough, John Ritter as Ben Hanscom, Annette
O'Toole as Beverly Marsh, Harry Anderson as Richie Tozier, Dennis
Christopher as Eddie Kaspbrak, Richard Masur as Stan Uris, and Tim Reid as
Mike Hanlon. The younger actors playing the flashback versions of the older
characters were, respectively, Jonathan Brandis, Brandon Crane, Emily
Perkins, Seth Green, Adam Faraizl, Ben Heller, and Marlon Taylor.

As in the novel, the central character of the film is the writer Bill
Denbrough, a thinly-veiled analogue of King himself. One of Denbrough's
novels, The Glowing, is seen on display in the Derry public library; this
is a reference to King's novel The Shining.

Radio Times magazine in 2004 held a survey for the scariest programme aired
on television, in which It came first. The X-Files came second. Others on
the top ten list included Twin Peaks, Ghostwatch and Tales of the
Unexpected.

It aired as a two-part television minseries on November 18, 1990 on ABC,
and loosely follows the plot of the novel. The first half of the film, set
in 1958, introduces the group of social outcasts, the "Losers", as they met
and form a tight-knit group in the face of a cruel and intolerant world.
They each individually come into contact with the child-killing monster
haunting their hometown of Derry, Maine, which they name "It". It usually
appears as Pennywise the Dancing Clown before taking the form of whatever
its child victim most greatly fears.

Spurred on by Bill Denbrough's desire for revenge on It for killing his
younger brother Georgie, the Losers resolve to locate Its home in the
sewers and destroy the threat to Derry once and for all. Despite managing
to inflict serious injuries upon the monster, they fail to finish the job,
allowing It to escape and recover over the years.

The second half of the film, set in 1990, focuses on the now-adult Losers
who reluctantly agree to return home (all of them except Mike Hanlon have
left Derry) to locate and destroy It once and for all. The Losers must
again face not only the terrible creature and the diminishing of their
circle after the suicide of Stan Uris, but also Henry Bowers (the bully who
made their childhoods miserable), now a madman under Its influence
determined to kill them all.

The television miniseries was done on a fairly modest budget, and thus
events in the book had to be ignored, especially if they would have
required expensive special effects. Wallace, the director, notes on the DVD
commentary that he was unhappy with the final result of the spider-like
"true" form of It.

The structure of the story is changed. In the movie, each of the people who
were affected by "It" while they were children receives a phone call asking
them to return to Derry. When this happens, they each have a flashback from
that year, and so this part of the story is revealed bit by bit. After the
adults have all arrived back in Derry, the story is presented in
chronological order throughout. Their rearrival in the book was told in
between the events of June and July of 1958. The end of the book alternated
between the characters going into the Barrens as children and as adults.

Another aspect of the television miniseries that is different from the
novel is the treatment of sexuality. In the novel, after the young Losers
escape from the sewer, Beverly Marsh has sex with the boys. This element of
sexual awakening, and the novel's mention of a gay bar in town and a gay-
bashing incident were dropped from the film. On the DVD audio commentary
Wallace states that he did not want to get into these sexuality issues.

Some of the major characters' backstories are either ignored or changed. In
the novel, Eddie Kaspbrak eventually tells his friends that he married a
neurotic woman similar to his mother, but in the television miniseries he
tells his friends that he is still a virgin, and there was possibly a
homoerotic undertone to his character as well.

The following characters were omitted from the film:

"It"'s natural enemy, the "Turtle"
Dorsey Corcoran and Eddie Corcoran, victims of "It" (Dorsey indirectly)
Mrs. Marsh, Beverly's mother
Vincent "Boogers" Taliendo, a rumor-spreading boy in the Losers' class
Patrick Hocksetter's younger brother Avery, who he murders by suffocation
Henry's insane father, Oscar "Butch" Bowers, who Henry kills by a knife to
the throat.
Beverly's friend Kay McCall. Beverly's husband Tom attacks her, demanding
to know where Beverly is.
The parents of many of the Losers, including Eddie and Mike
Adrian Mellon, a homosexual who is Its first victim in the cycle in 1985.
Dave Gardener, the man who finds Georgie's corpse. His son Harold, who is
also omitted from the film, is a witness during the murder of Adrian Mellon

--

Frederick Gotham
Aug 13 '06 #2
In article <11**********************@m79g2000cwm.googlegroups .com>,
"Anshu" <an***************@gmail.comwrote:

#include <iostream>
using std::cin;

int main() {
int a[100];
for(int i=0;;i++)
{cin>>a[i];
if(a[i]==0)
break;
for(int j=0;j<i;j++)
//NEW SORT MECHANISM
if(a[i]<a[j])
{int t=a[i];a[i]=a[j];a[j]=t;}
}
}

Adding the lines above will allow your program to compile and run.
Whether it does what you want depends on what you wanted it to do.
Aug 13 '06 #3
Daniel T. schrieb:
In article <11**********************@m79g2000cwm.googlegroups .com>,
"Anshu" <an***************@gmail.comwrote:

#include <iostream>
using std::cin;

int main() {
>int a[100];
for(int i=0;;i++)
for (int i = 0; i < 100; i++)

Avoids the possible buffer overrun.
>{cin>>a[i];
if(a[i]==0)
break;
for(int j=0;j<i;j++)
//NEW SORT MECHANISM
Not new, but inefficient. The runtime is O(n^2).
>if(a[i]<a[j])
{int t=a[i];a[i]=a[j];a[j]=t;}
}
}

Adding the lines above will allow your program to compile and run.
Whether it does what you want depends on what you wanted it to do.
Don't feed the trolls. ;-)

--
Thomas
Aug 13 '06 #4
"Anshu" <an***************@gmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
int a[100];
for(int i=0;;i++)
{cin>>a[i];
if(a[i]==0)
break;
for(int j=0;j<i;j++)
//NEW SORT MECHANISM
if(a[i]<a[j])
{int t=a[i];a[i]=a[j];a[j]=t;}
}
Sorry to tell you, but I this almost exact code at in the 8th grade on an
Apple IIe in Basic. It's called a "swap sort". Nothing new about it, and
it's just about the most innefecient sort algorithm there is.

Incidently, I was in the 8th grade about 29 years ago.
Aug 14 '06 #5

"Jim Langston" <ta*******@rocketmail.comwrote in message
news:MS****************@newsfe04.lga...
"Anshu" <an***************@gmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
>int a[100];
for(int i=0;;i++)
{cin>>a[i];
if(a[i]==0)
break;
for(int j=0;j<i;j++)
//NEW SORT MECHANISM
if(a[i]<a[j])
{int t=a[i];a[i]=a[j];a[j]=t;}
}

Sorry to tell you, but I this almost exact code at in the 8th grade on an
Apple IIe in Basic. It's called a "swap sort". Nothing new about it, and
it's just about the most innefecient sort algorithm there is.

Incidently, I was in the 8th grade about 29 years ago.
Better check your memory (or your math) again. If I recall correctly, the
Apple IIe wasn't released until 1983. :-)


Aug 14 '06 #6

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

Similar topics

7
by: JR | last post by:
Hey all, I have read part seven of the FAQ and searched for an answer but can not seem to find one. I am trying to do the all too common verify the data type with CIN. The code from the FAQ...
0
by: Vedran Vukotic | last post by:
Hello I made the following infinite loop that check's if the bot died and call it again: ------loadloop.pl----- #!/usr/bin/perl use strict; while (1) {
4
by: Byte | last post by:
The following code will not work for me: x = 1 while x == 1: print 'hello' x = input('What is x now?: ') while x == 2: print 'hello again'
66
by: mensanator | last post by:
Probably just me. I've only been using Access and SQL Server for 12 years, so I'm sure my opinions don't count for anything. I was, nevertheless, looking forward to Sqlite3. And now that gmpy...
12
by: sam | last post by:
hi all, i'm starting to put together a program to simulate the performance of an investment portfolio in a monte carlo manner doing x thousand iterations and extracting data from the results. ...
33
by: dmoran21 | last post by:
Hi all, I am a mathematician and I'm trying to write a program to try out a formula that I've derived. However, it seems that I've got an infinite loop and I don't quite understand why. I was...
3
by: stressedstudent | last post by:
I dont know where I am going wrong so I dont know which part to post, this is what I have, can anyone help me figure out where I am going wrong? THanks for any and all help. // into to c++ //...
6
by: Alenik1989 | last post by:
ok i have this code that executes for all # between 0 and 1001 perfectly. it is a cod to find the factors of inputed data and then determine it as a perfect number or not, also it suppose to loop...
1
by: d0ugg | last post by:
Hi all, I have a little question, my compiler is giving me the following error: error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const...
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: 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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.