Questions tagged as 'algoritmo'

1
answer

Loop loop in programming logic algorithm

I am in doubt on this issue: Write an algorithm that requests the age of several people (USE REPEAT). Enter the total number of people under 25 and the total number of people over 50. The program ends when age is negative (Not to be counted)....
asked by 13.04.2018 / 20:11
1
answer

Counter in PHP

I would like to be doing a PHP contactor in which I might be setting a time for the next number to appear. For example, the number 1 appears and then the number 2 appears replacing the number 1. It would be in the sort of a stopwatch. Can you...
asked by 14.04.2018 / 01:50
1
answer

Problem with weighted average logic

According to all the sources I consulted, several to be sure, the weighted average is calculated as follows: Add all values that have the same weight, then multiply that sum by that weight. This is done for all different values and weights. T...
asked by 18.03.2018 / 21:41
2
answers

Checking the number repeated in the matrix in C

I can not seem to find the error of this code. I made it to check if in a 4x4 array the number being inserted already exists. For some reason that I do not know he accepts repeated values sometimes and sometimes not ... int main() { bool bExit...
asked by 26.02.2018 / 00:34
3
answers

Error returning lower value

I'm trying to return the smallest value using va_args , which supports multiple arguments, but it always returns the same number: -13227; #include <stdio.h> #include <limits.h> #include <stdarg.h> int minimo(int args,...
asked by 02.01.2018 / 21:46
2
answers

Collecting data from an array

I have an exercise for college but I'm lost in my logic and how to solve it. I have to collect the results of games and set the score for each result. the winner takes 3 points, a draw guarantees 1 point and the defeat does not get any points....
asked by 05.12.2017 / 10:45
1
answer

Majority Image Algorithm Analysis

Algorithm help A vector with n images A = [1 ... n] has a majority image I if more than half of the vector images are equal I. You can use A [i] = A [j ] to check if the images in the i and j positions are the same. Show how to solve this pr...
asked by 10.10.2017 / 01:30
1
answer

C ++ program error: "[Error] expected primary-expression before 'F1'"

Hello, good evening everyone! I have a problem with my number occurrence function in the vector. The error:    [Error] expected primary-expression before 'F1' Could anyone help me solve this problem? Thanks in advance! #include <s...
asked by 09.10.2017 / 02:45
2
answers

Algorithm that reads three numbers and displays the result of the sum of the first two and multiplied by the third

public class Exercicio2 { @SuppressWarnings("unused") public static void main(String[] args) { Scanner entrada = new Scanner(System.in); int i = 0; int[] soma = new int[3]; int numero1, numero2 = 0; int total = 0;...
asked by 05.09.2017 / 10:16
1
answer

Printing binary tree graphically in C

Last week I was working on this code that prints binary tree graphically but I did not quite understand how to use it or if it has a bug because I type the number of nodes and the algorithm keeps processing and does not print. #include <stdi...
asked by 19.09.2017 / 12:36