Questions tagged as 'algoritmo'

2
answers

Mergesort targeting failure

I tried to recreate the Mergesort algorithm in C ++, but when compiling, the error "targeting failure" appears. Here is the code below. What can I be doing wrong? #include <iostream> using namespace std; void merge (int *arr, int lo, int...
asked by 12.03.2017 / 04:11
2
answers

Why does the following code print 'None' instead of the list?

The program must receive values in a quantity specified by the user. I need a list created with these values. Why this code does not work? quantidade = int(raw_input()) inicio = 0 lista1 = list() while inicio < quantidade: valor = int(r...
asked by 10.04.2016 / 01:53
1
answer

Program does not perform expected flow

After "Hello, my name is Locao ......" for me, in logic, should continue, and if the user wrote 'talk' he would say "Oh, so you want to talk ?!". But at that moment it stops, it simply does not appear anything after that, then if I write anythin...
asked by 31.07.2015 / 00:22
1
answer

How to check the winner in the old game [closed]

I'm playing an old game in C, I want to know how to check which player won by checking horizontal and vertical lines and diagonals. Here is my program done so far: #define tam 3 void desenhaTabuleiro(char M[tam][tam]); void zeraTabuleiro...
asked by 31.08.2014 / 02:49
1
answer

Operation with Factors of thehuxley.com site

Inputformat:AnintegerxcorrespondingtotheXoftheequationandanintegernindicatingthenumberoftermsintheseries,theinputendswhenx=0andn=0.OutputFormat:Afloating-pointnumberformattedtosixdecimalplaces.Whereistheerror?IdonotknowifI'mdoingitright.Bysubmit...
asked by 07.06.2014 / 04:59
2
answers

Initialize a function that has a string pointer as an argument

I wrote a function that exchanges the letter of a string for its successor using a string pointer. #include <stdio.h> #include <stdlib.h> /* 14) Implemente um algoritmo que receba uma string como parâmetro e substitua todas as...
asked by 21.11.2018 / 18:26
1
answer

Error Segmentation fault (core dumped) Double circular list

I've been trying to make a Double Circular List for hours. I have tried to correct all the errors but it gave a error 'Segmentation fault (core dumped)' that I have no idea what it is. Can anyone help me please? Below is my code: //Arquivo...
asked by 17.10.2018 / 06:45
1
answer

Transforming algorithm for visual

I'm starting to study algorithms, and to facilitate I try to take all the algorithms to the visualg. I'm having an example algorithm but I can not transform it to visualg can anyone help? I know that "size (phrase)" I change to Compr (phra...
asked by 10.10.2018 / 22:38
1
answer

(C) Make an algorithm that reads a string and removes vowels and whitespace

The code is copying ALL characters from one string to another and ignoring the copy condition. I know there is an easier way to remove spaces and vowels, which is bringing the next character to the current position, but the code was asked to do...
asked by 14.09.2018 / 20:13
1
answer

Problem creating minimax in chess game

I am coding a chess set only in pure C. The game itself is done, I've been trying to develop the minimax algorithm for some time. Currently the algorithm is almost ready, but it is not yet returning and I think the problem lies in the minimax fu...
asked by 22.05.2018 / 04:22