Posts by Gabriel Pellegrino • 386 points
10 posts
-
2
votes4
answers79
viewsA: Problem with a search algorithm on a vector and does not find
Python is much cooler, you’re programming in C, buddy! If you want to verify the existence or not of an element in a list, use the following comparator: if num in vetor: print("Encontrei!") else:…
-
0
votes2
answers104
viewsA: Is it correct to say that this Boolean simplification is correct?
You have an error in your solution by pointing out that: S = A’.B’ + B(A’.C + A) S = A’.B’ + B(C.1) You are implying that A'. C + A = 1 = (A' + A) A C C.(A'+A) 0 0 0 0 1 1 1 0 0 1 1 1 A C A'.C+A 0 0…
-
5
votes1
answer91
viewsA: Beginner in C! Doubt!
Hello, The OS community doesn’t usually like questions that look like questions enunciated, because it shows that you didn’t try to research anything before coming here. You know the basics of C?…
canswered Gabriel Pellegrino 386 -
2
votes1
answer49
viewsA: Help with nested loop
for i in yhat_tr: for a in d_tr: With these two lines you are iterating 500*500 times. For each value of i you iterate 500 values of a. What you need is something like for i, a in zip(yhat_tr,…
-
0
votes5
answers11043
viewsA: Recursive Fibonacci printing
This is a version of the Fibonacci algorithm using an auxiliary vector, which enables the calculation of values up to 50, instantaneously. For larger values, it will be necessary to use long int,…
-
1
votes2
answers196
viewsQ: Login Form
My login screen form HTML code (login.html): <form class="form-signin" method="post" action="login.php"> <span id="reauth-email" class="reauth-email"></span> <input type="email"…
-
0
votes3
answers6852
viewsA: language c is giving me a small error and I can not correct
The error is on the line int i; cat[i].nome = nome_da_categoria; the program does not know what is name_category, because this was not defined, if you want to add cat[i]. name, name_category, do so…
canswered Gabriel Pellegrino 386 -
3
votes1
answer1950
viewsA: How do I save a string of indefinite size to a structure?
To save a string of unknown size without spending extra memory, you need to read the street name in a buffer, a very large variable that can support any street name, for example, size 1000. Then use…
-
2
votes1
answer153
viewsA: How to relate two list-type data structures
I’ll help you from that response channel, okay? You commented that you have an error on line 178 of your code. Your problem is not updating the value of aux, ie your while-statement never stops…
canswered Gabriel Pellegrino 386 -
3
votes3
answers71
viewsA: Compiler accusing error I don’t know
The mistake happens because you passed die1 and die2 as parameters for the function sumofDie, and die1 and die2 are two vectors (pointers '*'); remembering that the function takes two int’s as…