- Strength to Increase Rep
- +8
- Strength to Decrease Rep
- -2
- Upvotes Received
- 15
- Posts with Upvotes
- 13
- Upvoting Members
- 13
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
Student
104 Posted Topics
[castpuzzle.net](https://hanayama-toys.com/product-category/puzzles/) My brother just brought me one from Munchen and I went crazy about it :P This is mine: [Cast Radix](https://hanayama-toys.com/product/cast-radix/). I found it to be a little more difficult than I thought at first (it's level 4) but I managed to take it apart and then assemble it again … | |
Re: Cookies and milk - I ordered a pizza but I'm too hungry to wait without eating :P | |
Re: I'd do it that way too, just I'd add a little if-else-abs() trick to handle n<0 (otherwise it would print -567 reversed as -7-6-5). something like [CODE=C++]if(n<0) { cout << "-" << abs(n%10); revprint(n/-10); } else { cout << n%10; revprint(n/10); }[/CODE] | |
Hi all there. Firstly I apologize if this is not a specific question (please do point it out if you find this unpolite). I don't have real problems so if you're not personally interested feel free to save your time and close this thread :) Anyway, I had to write … | |
Re: [QUOTE=Narue;725597]Or you can just turn in something that will shut your teacher up, like this: [code=cplusplus] #include <iostream> int main() { for ( int i = 0; i < 32; i++ ) { for ( int j = 0; j <= i; j++ ) std::cout.put ( ~i & j ? … | |
Re: It's not that difficult to implement one by yourself: [CODE=C++]double myfabs(double x) { if(x>=0) { return ***; } else { return ***; } }[/CODE] It should be easy for you to figure out what you have to return in each case ;-) | |
Re: > Is it child abuse to name your son Adolf Hitler? Definitely yes imo! | |
Re: If a function returns, say, an int, you can use a call to that function in every place you could have used an int. Examples: [code=c++]#include <iostream> int sumFunction(int a, int b) { return a + b; } int main() { int a = 5, b = 7, c = … | |
Re: [ICODE]getline(cin, line);[/ICODE] Shouldn't you take your line from the ifstream? What daviddoria meant with the add function is that you are every time rewriting the file instead of just adding lines. Also you are not closing anything. Edit: You declare [ICODE]ifstream a;[/ICODE] in main but you make no use of … | |
Re: Sounds like a subset generating problem to me. I did almost the same thing a while ago, try reading [URL="http://www.daniweb.com/forums/thread159859.html"]this[/URL]. Hope that helps. | |
Re: You could use [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/atoi.html"]atoi[/URL] or write your own char-to-digit converter, like this: [code=c++]int char2int(char c) { switch(c) { case '0': { return 0; } case '1': { return 1; } // ... and so on } }[/code] You could also do it without the switch, but I'll let you figure … | |
Hi all there. Given the huge amount of blackjack/card games threads and me being personally interested in poker and other games, I was feeling like starting to play with a few useful (at least I hope so) classes for dealing (no pun intended :P) with card games. I started my … | |
Re: Check out [URL="http://www.daniweb.com/forums/post755264.html"]this[/URL], I hope it'll help :-) It's still work in progress though there are some changes made... | |
Re: No. We won't do your homework for you. Read the forum rules, post [b]your[/b] attempt and [b]then[/b] ask for help (specifically). Make sure you use code tags. | |
Re: [QUOTE=ninja_gs;758769] JUST LOOK AT NAURE 's ATTITUDE [COLOR="Red"]"I'm here to prove you wrong"[/COLOR] So All Ppl Just think of it [COLOR="Red"]s(he) is Not here To Motivate or Help s(he) is Here to Make you comment and prove you are Wrong.. [/COLOR][/QUOTE] Here: [quote=Plato on Gorgias]And what is my sort? you … | |
Re: Astonishing ignorance. Thanks for posting, I'm waiting to read Chapter 2 [quote]It looks like we will get to meet in his office when School starts again after the holiday. I am anxious to meet a person who is this uninformed and still holds a position of authority and learnedness over … | |
Re: Either that or [code=c++]for(int month = 0; month < numYears*12; month++) { std::cout << "Enter rainfall (in inches) for month " << (month%12) + 1 << " of year " << (month/12) + 1 << std::endl; // do what you want }[/code] This assuming I understood your question. Please read … | |
Re: 1. Are you allowed to use recursion? If so it's easy. 2. Please use [URL="http://www.daniweb.com/forums/misc-explaincode.html"]code tags[/URL] when posting code. | |
Re: Read [URL="http://www.daniweb.com/forums/announcement8-2.html"]this[/URL] closely. No one is going to post-fed you a solution to [b]your[/b] homework, so show some effort or prepare to be ignored. After all it's [b]your[/b] programming class, not ours. | |
Re: Maybe [URL="http://www.daniweb.com/forums/thread161832.html"]this thread[/URL] will help (it's still "work in progress" but may give you some ideas) Hope this helps. | |
Re: Change [ICODE]a[i]= tmp;[/ICODE] with [ICODE]a += tmp;[/ICODE]. | |
Re: I you would like to keep track of previous executions of your program I suggest you to write these informations in a file - you can't keep an array from one execution to another afaik Oo | |
Re: [code=c++]string myFile("rawDictionary2"); int totalWords= wordCount(myFile);[/code] you are sending in a string, why do you want it to accept an ifstream? | |
Re: Also: why do you check i? Instead of [ICODE]if(i=='m' && 'male')[/ICODE] try [ICODE]if(s=="m" || s=="male")[/ICODE]. First correct your toLowerCase as AncientDragon suggested, then fix "minor" things like the one I pointed out to you (and others like double s input) | |
Re: State_Tax is expecting float, you are passing float*. Change [ICODE]*statetax = State_Tax(federaltax);[/ICODE] to [ICODE]*statetax = State_Tax(*federaltax);[/ICODE] | |
Re: From the link you posted: [quote]A naive algorithm for finding palindromes calculates all positions of an input array, and for each of those positions, calculates the length of the longest palindrome around that position.[/quote] That shouldn't be much difficult to implement, and [quote]For each position, this function may take an … | |
Re: A similar thing happened in Genova, Italy, during 27th G8 summing in 2001. A policeman shot dead a masked guy who was throwing him a fire extinguisher [URL="http://notimaz.blog.kataweb.it/files/photos/uncategorized/carlo4_1.jpg"](photo)[/URL]. You can see it in the act of assaulting the officer inside the car (from where he fired). There's still a really … | |
Re: [QUOTE=Salem;749893]> He also will undergo a psychiatric evaluation. Yup, faith is a mental illness - in all it's forms.[/QUOTE] Great, I completely agree. Lol for the rest of your post :-S | |
Re: Everlast - Love, War and the Ghost of Whitey Ford. A new entry in my collection - I really like it so far Next one in playlist is Ellen Allien & Apparat - Orchestra of Bubbles | |
Re: no looping at all - just one multiplication needed. what have you tried? | |
Re: Well, @ nido24: 1 - You shouldn't post your questions in other's threads 2 - When you'll start your own thread asking for help, make sure you put a [b]real[/b] question in there! It's not like we have a crystal ball nor like we can access to your machine and … | |
Re: Well, thanks! A friend of mine is going to study this subject and he's in need of building a bibliography, and I could make it an interesting reading too. (hope this won't get too much off topic - but should anyone had more books on this matter to suggest my … | |
Re: I study piano since I was 6 - so it's piano for me. Be it classical (my favourite) or jazz or progressive keyboards :P I'm also looking forward to start learning a second one soon, and since I have no place for drums atm I guess I'll go with sax. … | |
Re: If all the values are stored in the same array of length [ICODE]arraylength[/ICODE] then this will work [CODE=C++] int average = 0; for(int i = 0; i<arraylength; i++) { average += array[i]; } average /= arraylength; [/CODE] | |
Re: You should get ephrase with [ICODE]getline(cin, ephrase);[/ICODE] instead of [ICODE]cin >> ephrase;[/ICODE]. Before doing that, though, you should flush the input stream (great [URL="http://www.daniweb.com/forums/thread90228.html"]thread[/URL] on this by Narue) because of the previous [ICODE]cin >> choice;[/ICODE]. Also, your program would not translate "I am cool" as long as you don't convert … | |
Re: Just put [ICODE]sum = 0;[/ICODE] before starting to add the second month rainfalls. Please read [URL="http://www.daniweb.com/forums/misc-explaincode.html"]this[/URL] and make sure to use code tags when posting code from now on EDIT: sweeya was faster, sorry. | |
Re: [QUOTE=C++.java;751061]i want an instant answer[/QUOTE] First! Is that instant enough for you? Btw: is there any question to answer at all? ... | |
Re: You shouldn't post the same question in two different threads. | |
| |
Re: First general advice: use code tags ([URL="http://www.daniweb.com/forums/misc-explaincode.html"]here[/URL] is an explanation of how) when posting code. Second general advice: a more descriptive thread title would result in great improvement of the forum readability - so why not something like "problem with gcd algorithm and logarithms" ? Think about it on the … | |
Re: As long as you are decrementing y you should put y in your base cases checks, otherwise [ICODE]multiply(2, wathever);[/ICODE] would result in *endless* recursion. EDIT: Sorry, Salem beated me in speed. | |
Re: something like this should work (warning: untested) [CODE]max_sequence := 0 max_sequence_start := 0 for i from 0 to end of file: current_sequence_start := i flag = true; int count := 1 while i < end of file AND flag == true: i++ if sequence[i] != sequence[i-1]: flag := false i-- … | |
Re: [QUOTE=cinderla;749541]hi, i need to read a file and to store contents in buffer. to read the first 8 bytes and to move the pointer to read the strings in that file.[/QUOTE] Great, good to know. What did you tried and precisely how did it fail to work? Post both the … | |
Re: [QUOTE=elkoshli;749545]Hi I have exam after 12 hours, please help me to writing those programs…[/QUOTE] Well, you better hurry then. Although you could have [b]invested[/b] 5 minutes of your time in reading [URL="http://www.daniweb.com/forums/announcement8-2.html"]this[/URL] (even if I think that just the [b]title[/b] is pretty explicative). By doing that you could have obtained … | |
Re: Some general considerations first: 1 - main must return an int, so it's [ICODE]int main()[/ICODE] and not [ICODE]void main()[/ICODE]. I think your compiler should have issued a warning at least. Here's an explanation of [URL="http://www.gidnetwork.com/b-66.html"]why.[/URL] 2 - you use deprecated [ICODE]<iostream.h>[/ICODE] instead of [ICODE]<iostream>[/ICODE]. To this also your compiler should … | |
Re: I think that the resulting array is the list of positions that the elements of the first array occupied before being sorted. For example the min elements of the first array is 10 and it was in position 2, then we have 20 at position 1, 30 at position 3 … | |
Re: 20! I'm 21 so I'm feeling proud of my brain :D he's beating me on the long distance! :P | |
Re: Really fun! [ICODE]Right Click -> Bookmark this tab[/ICODE] 1191... there's no italian words list so I don't think I can do better than this at the moment ;) |
The End.