- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re:
Hi, can anyone help me with my code? Im trying to reverse my string using stack... but when it compiles and put in a string and press enter... nothing happens... Any suggestions? [CODE]#include <iostream> #include<stack> #include<string> using namespace std; int main() { stack <string> s; string a; cout << "Enter: … |
|
okay, i don't have a problem coding the game... that part would be easy. but the problem is to output the lease number of rotations needed to complete the game, so for example... 123 => 413 456 => 526 789 => 789 (rotation of the top left corner) that's what … |
|
Re:
Okay, I'm making a program that will let you traverse a maze where the beginning is the top right corner (coming from the right) and it ends in the bottom left corner (going to the right). We have a 2D array for the board and are using a stack to … |
|
Re:
[CODE]#include <iostream> #include<string> int main() { for(int i = 0; i <= 10; ++i) { std::string triangle(i, '*'); std::cout << triangle << std::endl; } for(;;) std::cin.get(); return 0; } [/CODE] As title says is this code ok or should i do it another way? |
|
Re:
I have a program and I want to know how would I put test cases on this program. its an sum and average program and so I'm trying to figure out how test it. I don't want the answer to my program but i want to see how a test … |
|
Re:
Trying to make a program that where user inputs 10 numbers (no negative numbers) and then displays the sum and average. I get a error if I don't have ; after else statement, before sum = 0. I get a warning of coversion from int to float, and warning of … |
|
heya... ok, so i was browsing the net to find out if there's a good text on this algorithm, but i don't seem to be able to find one. people are obviously using it, but, hey, there's no info on it. the part i get is the theory on how … |
|
okay, so i came up with this idea of making a program to evaluate my code. it's supposed to take the code, compile it, run it on several test cases (given in one file each) and report how the code did (which test cases it passed, which cases it failed...) … |
|
okay...i've got another wired counting problem, this time it's about rectangles! gotta find the minimum number of lines to divide a rectangle into squares! i went for...ehh well a dumb idea of cutting the max square off, and cutting the little ones recursively, but... doesn't always work. you're given the … |
|
Re:
The requirements are actually simple, just asking to sort a few, say 10, 20 or so, intergers in ascending order. However, array and pointers are not allowed to be used, and just the fundamental knowledge about flow control are permitted. The hints are as follows: 1. Initialize a variable F … |
|
Re:
I create the simple template structure like this [CODE] #include <iostream> template <class info> struct box { info data; }; int main() { box<int> b1; b1.data = 1; std::cout<<b1.data; return 0;typedef box square; } [/CODE] Now i want to use the typedef for this template structure. I could not figure … |
|
okay, this is the problem (variation of the knapsack coins problem): you've got 4 coin types: 1 cent, 2 cents, 5 cents and a quarter...infinite amount of each. I'm supposed to find the number of ways in which the coins can be arranged to form the sum of some integer … |
|
Re:
Hello i have a project to write a program that takes 2 binomials from a text file then factor them and output it into another text file. I'm curious on how to begin going about this do i take the 2 binomials such as (x+5)(x+9) and put them in a … |
|
Re:
I get the right input, but its giving out the numbers unformatted in the output ie: when it should be input: 3 5 (7) $58 3,400 output: 3 5 -7 58 3400 it gives me 3 5 -7 5 8 3 4 0 0 [code] inFile.get(aa); while( ! inFile.eof()) { … |
|
Re:
Hey All - i am currently working on an assignment for a computer science programming class. I have to find and print all the prime numbers from 2 to N (N being a number read in from file). I have some code but i do can not get my mind … |
|
every time i make my own rounding routine with precision, i see my compiler suggesting a function long double round(long double x, int precision); so i was wondering if someone knows what library it comes from, i surely wasn't able to find it... thanks |
|
Re:
Hello I have written my program and right now I am stuck in something that I thought that was going to be easy. I have the [B]char buffer[/B], which receives from the serial port some letters and 2 numbers at position 3, lenght 2. I want to extract those numbers … |
|
i got myself a big pile of components yesterday, an amd dual core procesor, a new motherboard (biostar ta770 a2+) and a new graphics card, nvidia(club3d geforce 9600gt overlocked). so now i've put it all together, the computer starts normally but i don't get any output on my monitor, the … |
|
ok, so this is my problem... i have an array of items, which i want to sum to x or above in a most efficient way... is there a way for doing this? cause all the values are 64 bit ints. i tried recursion but it's slow cause i can … |
|
given two arrays of n numbers, a[] and b[], and a number c, find the largest sum of elements from a[] so the sum of same-indexed elements from b[] don't go over c... i really have no idea... only recursion works but too slow :( heeeeelp! |
|
could someone please tell me if there are local stores in NY where i can get this calculator? if there are can i please have the adress or something? thanks. |
|
okay, so i gotta make a good enough hash function that should be able to make me a key for out of two integers ( -1000000 <= x, y <= 1000000 ), and should work...well atleast 80% of the time so i could store these in an one-dimensional array... i've … |
|
okay so i've got n and an array of n numbers, i have to go through all the three's of numbers like a[i], a[j], a[k] so that i < j < k and take the maximum of each such numbers (max of a[i], a[j], a[k]). my first guess is three … |
|
Re:
Ok so ive strted to try and teach myself C++ cause in a few years when i go to college i wanna study computer science or engineering. I downloaded Dev C+++ and followed some small simple tuts on how to do C++. 2 of the tuts started off simple and … |
|
the problem is to find the minimum numbers to be popped from an array to make it sorted. so for example 12534756, you can pop all but one, but it's best to pop 5 and 7 cause it's the least needed to make it sorted. I'm having difficulties finding a … |
|
Re:
Suppose we have to write a program where a mark out of 60 is entered and then the corresponding symbol has to be displayed. A message indicating whether the person has passed or not, should also be displayed. We decide to write the program in three steps. You should submit … |
|
Re:
Hey could someone help me bout my problem.... can someone tell me how to make an asterisk frame using for loop statement in C++ and also 1 thing.... how can i display an input letters into an asterisk... eg.. username: bulbulito password: ******** |
|
Re:
hello i hope you can help me :icon_question: i just want to know how to code binary value to decimal value using c++ im willing to wait for your response :) thanks a lot godspeed |
|
Re:
Hello, I was just looking up the threads and I must say I saw a lot of codes with "std::string", "std::cout", etc... I just wanna ask, wouldn't it be better if you just wrote "using namespace std" instead ? I am doing it all the time, but if it's wrong … |
|
Re:
Hey ppl, I was browsing thro the topcoder sample problems and came up with this one. Plz suggest some good algorithm for this. Problem Statement Note: Please keep programs under 7000 characters in length. Thank you Class Name: SquareDigits Method Name: smallestResult Parameters: int Returns: int Define the function S(x) … |