A script in C or C ++ could write algorithms on Lua (by brute force , that is, test several possible combinations) based on a database with algorithm results.
The idea is to arrive at the most efficient algorithm for a given goal, for exampl...
I'm having a question in the program I made to represent the game cho-han bakuchi, this game has as a rule to roll two 6-sided dice in a cup before showing the dice if the bet is made in which the player speaks cho pairs) or han (odd) and then t...
I'm trying to do the following exercise:
10) A fruit bowl is selling fruits with the following price list:
Até 5 Kg Acima de 5 Kg Morango R$ 2,50 por Kg R$ 2,20 por Kg Maçã R$ 1,80 por Kg R$ 1,50 por Kg
If the cust...
Having the following code:
0 #include<stdio.h>
1
2 int
3 main(void)
4 {
5 int x;
6 x = -3;
7
8 for (int i = 0; i < 5; i++)
9 {
10 printf("%d\n", (unsigned int) (x - i)); //n...
My teacher of algorithms and programming techniques spent an exercise in which a = "123567348" and of that I would say which numbers are even and which are prime. He said he would have to use substr() , and passed an example:
#inc...
I'm having a recursion challenge. The goal is to return "n + the sum of the last digit to the left". Example:
Entry: 54321
Output: 54326 (54321 + 5)
But the only way I got it was like this:
#include <stdio.h>
int somault(int n)...
I am with pending exercise to find the largest element in a fixed vector of 10 elements.
But when I declare the integer of the vector works, but when I ask the user to enter the values it does not work.
int i, v[10];
int maior = v[0];
for(i =...
The problem is as follows:
A function receives an int as a parameter, and returns it written to the contrary and another to test if the input number and the inverted number is palindrome.
I was able to solve the problem of identifying...