Posts by Carlos Mendes • 147 points
5 posts
-
0
votes1
answer630
viewsQ: Vector sorting of character vectors with qsort <stdlib. h>
The following program is not ordering the chars vector correctly, but I don’t know why. Maybe it’s my auxiliary function "cmpstr" that isn’t returning the right value in some cases, or my qsort…
-
1
votes1
answer29
viewsQ: Vector sorting of character vectors with qsort <cstdlib>
The following program is not ordering the chars vector correctly, but I don’t know why. Maybe it’s my auxiliary function "cmpstr" that isn’t returning the right value in some cases, or my qsort…
-
2
votes1
answer2466
viewsQ: Empty list matrix initialization "{ }" in C++
From what I have seen, it is possible to initialize a vector with the empty list, in C++, but not in C, so that all vector elements are 0: int meuVetor[10] = {}; // Todos os elementos 0, em C++ What…
-
6
votes1
answer477
viewsQ: Time difference between stdio. h and iostream
I made two codes so that an online Judge corrected. They are essentially the same. But the with stdio. h is accepted and the with the iostream is not, because it exceeds the time limit. Why this…
-
4
votes2
answers180
viewsQ: Very large integer does not work
My code is like this: #include <stdio.h> int main() { unsigned long int L, N; scanf("%lu%lu", &L, &N); printf("%lu\n", (L-(N-1))*(L-(N-1)) + (N-1)); return 0; } When the test case has…