ndeniche 402 Posting Virtuoso Featured Poster
ndeniche 402 Posting Virtuoso Featured Poster
christina>you commented: aw thanks. :) +21
iamthwee commented: Poor, real poor -3
^is very friendly
^not bad himself
^is in my contact list :P
it's a secret message from the devil... remember 'www' looks like vi-vi-vi', which means 666, which is the number of the beast... pretty sure that's it...
^a very nice guy
^is new here...
hope you enjoy it...
^is > you
^is in for the next chess tournament
^is right
^reached his 200 posts
^is hilarious
^is like a dude in a chick's body... (in a good way) :P
^has a cool pic from space
i think it would be easier and the same results will be reached if hi truncates the number by dividing it:
#include <iostream>
using namespace std;
int main(){
int n1,n2,n3;
cout<<"Input a 7-9 digit number";
cin>>n3;
1.- the leftmost number (the millions) can be obtained by dividing the whole number by 1,000,000... since the three variables are int, the decimals will be truncated and will be lost... then, multiply this number by 1,000,000 and substract it from the original one... that will get rid of the millions...
n1=n3/1000000;
n3-=n1*1000000;
2.- for the middle number (the thousands), do the same: divide your resulting number from the last operation by 1,000, then multiply it by 1000 and substract it from the original one...
n2=n3/1000;
n3-=n2*1000;
3.- the resulting number is your rightmost number(the hundreds).
next: output the number inserting commasbetween them...
cout<<"The number is: "<<n1<<","<<n2<<","<<n3<<endl;
system("pause");
return 0;
}
and it gives the same results as the one Hamrick suggested...
you could divide you 7-9 digit number into 3 numbers and place commas between them...
^posts nice thoughts
do i hear dobby?
i bet she does...
^doesn't give a s*** (in a good way)
^is soo good looking... :D
may we see how you structured your Test class?
^is a quick poster
^ is really cute
In my point of view smokers have to consider the non-smokers. Indeed second hand smoke is harmful. I usually throw my newly lighted cigarretes when is see kids in the area.
that's a good thing to do... though i'd just move somewhere else...
i don't hang out @ the irc and i was extremely boosted...
just write a little prgram that generates 1000 numbers between 10 and 100 using rand() % 100 + 10 to generate the numbers and save them to a file. Then you can write the other program as your teacher instructed.
actually it would be rand()%90 + 10
there is a function in c++ called strlen() which tells you the length of an array... if not, you can use a while loop with a counter that exits when array[i]=='\0'
btw... i'm using DEV... maybe that influenced some errors...
I wish to ask how can permu and input has 4 size when dol is 0 ,1, 2 ,'\0'
because this would mean that it can fit in 4 charecters with null .
then null charecter should be at position 4 i.e permu[4]='\0';
Please correct if I am wrong?
actually, '\0'
would be @ permu[3]
my rep was also boosted... my whole rep list is full with Rash saying "a man, a plan a canal... panama!"... i was boosted from 214 to 712 in a blink of an eye... i jumped from 46th place to 6th... right over Ancient Dragon...
i'm not complaining about it... but i'd rather earn my rep, than being given it out randomly...
it's not that hard anyways... all you need are two arrays, and shift the character positions between them... it should go something like this:
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
int i=0,j=0;
char string[100],permut[100],temp;
gets(string);
strcpy(permut,string);
puts(permut);
i=0;
getchar();
while (string[i]!='\0'){
while (permut[j]!='\0'){
temp=permut[j];
permut[j]=permut[i];
permut[i]=temp;
puts(permut);
j++;
}i++;
}getchar();
_exit(0);
return 0;
}
i think it's enough for a lead start... it doesn't show all the permutations, but the logic you need to use is somewhat like that...
have you tried it in the compiler? show us the logic you've used...
>>the text equivalent of putting my fingers in my ears and saying "lalalalala!".
lol... i actually laughed when i read that... because it is actually true...
> Smoking is bad for you.
Smoking is good for you, just like chocolate and wine. And just like chocolate and wine, smoking in excess is bad for you.
that's the best comment i've ever heard in my life... omg... seriously...
if you show us how far you have gone, it will be easier for us to help you
the thing could be, making all those people applying for green cards prove they are going to live in america to study or to work with a certificate from a college or something like that, so no one goes through to start from zero, but having a firm start...
i'm getting dizzy already because of the color changing of the multi-quotes...
conclusion:
thank god in Honduras stuff like that will (most likely) never happed... haha!!! hurray for me!!!
for all of those who are being screwed up with this law... haha!!! losers!!!
that's the spirit...
i think everyone here agrees smoking indoors should be illegal right?
hahaha... i like it when Narue adds some fire to discussions...
i guess the title is missing a question mark in the end...
maybe you show us what you have done and we can show you the right way... WE DON'T GIVE HOMEWORK TO THOSE WHO DON'T SHOW ANY EFFORT
we surely can do it... can you?
And naturally you're qualified to make that choice. :icon_rolleyes: Tell me, have you ever thought to ask a smoker not to smoke around you? I have, and to date nobody has ever refused to give me space or put out their cigarette when I asked politely. Most of the time they immediately put it out and don't light up again while I'm around. Smokers aren't evil people who intentionally try to hurt you, so stop trying to act righteous.
thank you very much... i though you would never defend me in any way... :D
and actually, no... we don't mind putting outour cigars when we re making other people uncomfortable... i even make sure to keep my distance to other people that are not smoking when it is possible...
i would say that i wouldn't care if they made it illegal to smoke in restaurants, but that's far from happening here...:P
that is always given... i mean... when you say party animal, immediately you get the picture of alcohol... lol
not equal, but related... even more if you're a showoff...
i don't know... it's somewhat fun to be the showoff party animal... in a moderated way of course...
because they're stupidly funny... not right, but funny... don't you think?
the truth is, i know what i am doing to my body... i am aware that i'm harming myself... i know it is bad for me and for everyone...
next time i guess i'd better team up in the right side... and search for better arguents... :D