- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
15 Posted Topics
Hi, I have to create a set of structs but i don't know how because it needs to check the equality between them. For example: [CODE] struct something{ int x,y; string word; }; set<something> s; [/CODE] Can you help me?
Hi, I am trying to write a program that will read an integer as a string and it will add 1 to this integer. For example if it read 234, it will return 235. My attempt is this: [CODE] #include <fstream> #include <string> using namespace std; void addone(string& num){ int …
Hi, how can i save the text from a file in a 2d array? For example the file will be like: ebjevjhb tgbvtrjk trjgbj tgrrktgtr kgtrl tkltrg t feg ergfern gn sdcx xssw And i want to save this in a char 2d array like: char str[3][100] so str[0]="ebjevjhb tgbvtrjk …
I can't understand why you have if outside of a loop. You could write it like: [CODE]#include <iostream.h> void main() { int sum=0; int i, a[6]; int range; cout<<"Enter a range"<<endl; cin>>range; cout<<"Enter some numbers"<<endl; for(i=0;i<range; i++) { cin>>a[i]; } for (i=0;i<range;i++){ if (a[i]%2==0) { sum+=a[i]; } } cout<<"Sum of …
Hi, I want to make a global 2D array ( i mean outside of the main function), so it will be available from all the functions. But my problem is how can i read it's size from the keyboard? If anyone know, plz help me. Thanks in advance.
Hi, i have to sort two arrays in a specific way. I have two parallel arrays A[N] and B[N]. Ι have to sort A in descending order. The changes in A should be happened in B at the same time. If 2 or more items in A is the same, …
Hello, Can you help me to install the gtk library in Dev c++. I have installed it in Linux but i dont know how to install it in Windows. Thanks in advance.
Hello, I have seen many problems that inputs an unknown size of tests and i have to output the result of each test. An example is here: [QUOTE] The Input The input will consist of a series of pairs of integers i and j, one pair of integers per line. …
Hello, I have seen many problems that deals with big integers. I use C++ and it can handle only some digits. Can you help me on how to represent and use them?
Can i make a function with a vector<int> parameter instead of an int array?
I think that you can use a stack. First you can put the characters of the string in a stack and then to remove them from the stack. Stack is Last In First Out so after you do that process your string will be reversed.
I am trying to solve an algorithmic problem. First of all the user inputs the coordinates of some nodes. I have to go to the node with the biggest x( let name it E) and then to return to the start that will always be the node (0,0)( let name …
I need to learn brute-force search because i think that it will help me to solve a problem on graphs. Do you know any good tutorial for brute-force search?
I have to make a tree that will have unlimited leafs in each root. I don't have much experience in binary trees and i am confused on how to make this tree. Can you help me please?
Hi, i am trying to make an algorithm that will read the nodes of a graph. Then i should find the shortest path that i have to follow in order to pass from all the nodes. I am trying to make it so the algorithm will calculate every possible path …
The End.
mimis