Posts by flavio • 317 points
17 posts
-
-2
votes1
answer58
viewsQ: Switch from string to int c++
Next, I’m doing a function that receives the date this way "XX/XX/XXXX" but I have to perform checks as day, month, leap year, these things, and I’m using its format in string on account of the…
-
-1
votes1
answer70
viewsQ: doubt in array
My program needs to receive two vectors, A and B. This defines the set To Pikachu B as the set formed by the elements that appear in A or B. In addition, it has the set To Chikorite B as the set…
-
0
votes1
answer54
viewsQ: Infinite loop in height growth analysis
Gustavo is 1.40 meters and grows G centimeters per year, while Juliano is 1.10 and grows J centimeters per year. My show is giving a loop infinite when I run. #include<stdio.h> int main() {…
-
2
votes2
answers2641
viewsQ: Find lower vector value recursively
My recursive function needs to return the smallest vector, only it is always returning 0. What’s wrong with my logic? My job: int menor(int vet[], int i) { int m=0; if(vet[i] == 0) { m=vet[i];…
-
2
votes1
answer123
viewsQ: Error in recursive logic
My recursive function needs to calculate the power from b to N is giving error "Segmentation failure (recorded core image)", which can be? My job: int potencia(int b, int n, int a){ if(n == 0){…
-
0
votes2
answers47
viewsQ: Vector inside the matrix?
My function needs to find the line where the first occurrence of a vector occurs within a matrix and return its line. But it is always returning the wrong line, my logic is wrong? My job: int busca(…
-
1
votes1
answer2674
viewsQ: Matrix multiplication and storing in another matrix?
is a function that receives three integer matrices A, B and C, and two whole n and m representing the number of rows and columns of these matrices. This function shall calculate the multiplication…
-
1
votes2
answers392
viewsQ: Array sum storage in vector
This function I created needs to calculate the summing up of each column of the matrix and store in a vector position. However, it is not giving the desired result, I think it may be within the…
-
1
votes1
answer424
viewsQ: Discover string inside string without string library. h?
My function needs to check if one string is contained in another and speak where the first place where the letter was equal occurred, but is always returning the size of the first string What’s…
-
0
votes1
answer547
viewsQ: Check whether a string is contained in another string without the string library. h?
I need to check if a string is contained in another and returns the position at which the first letter appeared. I saw here on the site the following code, but I can not use the library string.h.…
-
3
votes1
answer96
viewsQ: Lexicographically compute the letter of a string
My function needs to lexicographically calculate the value of the characters (by the ASCII table) of the string. For example: "Alibaba" and "Came"'A' = 65 and 'V' = 8665 - 86 = -21. Then the…
-
2
votes1
answer1360
viewsQ: Turn lowercase into string
I need to do a function that takes two strings, and switch places both. But if you have a capital letter in the first one, at the time of converting you need to go to lowercase. I tried to do, only…
-
1
votes3
answers107
viewsQ: Help with string programming logic?
I’m new to this string area and I’m having a hard time. My algorithm should find and return the first time of the key(which the user enters) in the string, otherwise -1 must be returned. q is wrong…
-
1
votes1
answer79
viewsQ: What is wrong in the double variable
I need to make an algorithm that the user informs two values and return the biggest among them using double, but when compiling it from the error pointing something in double but do not know how to…
-
-1
votes2
answers255
viewsQ: My program only runs the first if?
I need to work out an algorithm that takes 3 real values and checks whether these values can be the side lengths of a triangle, and in this case, return what kind of triangle is formed. Why x, y and…
-
3
votes3
answers1906
viewsQ: Decimal to octal conversion
I need to create an algorithm that converts decimal to octal, but my ta converting wrong, someone can help me as it would be right? #include <stdio.h> int decim(int n) { int i,a; int octal;…
-
1
votes2
answers76
viewsQ: What is wrong with the logic of this code that sums bands of numbers?
My algorithm needs to sum all the values between a and b, for example if I type a=3 e b=6 the program needs to speak 3 7 12 18 (3+4= 7/ 7+5=12 / 12+6=18) only he only makes the first two then starts…