Jump to content
Sign in to follow this  
Archerzz

Just Got Back From Camp And Need Good Challenge

Recommended Posts

So dare I ask how old both of you are?? :P

520615[/snapback]

 

Me (probly not but I will say anyway)? 19... (20 on Sunday...). Never guess I was that old would you? Mentally I am about.... 10? :)

 

How about making as she loves she loves me not program.  Similar to the flower thing.

520634[/snapback]

 

Just says:

 

She loves me

She loves me not

 

and repeat forever? :)

Share this post


Link to post
Share on other sites
Just says:

 

She loves me

She loves me not

 

and repeat forever? :)

520639[/snapback]

 

I would have it loop for a random number. If you where smart only odd numbers (but thats up to you.)

But the infinite loop is an interesting Idea.

Share this post


Link to post
Share on other sites

we are both 17 I am about 3 months older than her

 

This is my version of the She loves me she loves me not flower :P

 

#include <iostream>
#include <string.h>
#include <stdlib.h>
using namespace std;

int main()
{
   int i;
   int x;
   int z;
   string love[2] = {"She Loves Me\n", "She Loves Me NOT!\n"};
   
   cout << "Give me a number between 1 and 10: ";
   cin >> i;
   cout << "Give me another number between 100 and 500: ";
   cin >> x;
   cout << "Give me your age: ";
   cin >> z;
   
   int end = i * x + 15 * (rand() * z);
   int begin = 0;
   
   while (begin < end)
   {
         cout << love[0];
         cout << love[1];
         
         begin++;          
   }
   
   system("pause");
   return 0;
}

Share this post


Link to post
Share on other sites

The string typedef is part of the std namespace. So is system(). Yes, came as a surprise to me too. So, you won't be needing the string.h include.

Share this post


Link to post
Share on other sites

I know I put it there from habit just incase I need to change something and another thing is if you look closely at my while statement it wont work. Can you guess why.......

Share this post


Link to post
Share on other sites
I know I put it there from habit just incase I need to change something and another thing is if you look closely at my while statement it wont work.  Can you guess why.......

520874[/snapback]

 

Sure, it'll always end up with love[1] last, so it's always going to be...

 

"She Loves Me NOT!"

 

*cries*

Share this post


Link to post
Share on other sites

Yup I figured that one out my self woooohooo, but fixing it is where the problem lies

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...