Posts by Lorenzo Moulin • 76 points
5 posts
-
0
votes1
answer69
viewsA: Segmentation failure (recorded core image) decimal to binary conversion
In while(d/2 > 0){ vetor[a] = b % 2; b /= 2; a--; b--; } vector change[a] = b % 2; per vector[a] = d % 2 and change b /= 2; for d /=2; In for(a=0; a<bits; b++) printf("%d", vetor[a]); trade…
-
0
votes2
answers1331
viewsA: Intermediate vectors in C
I managed to create a function that does this in O(n+m): //n é o tamanho do vetor a, m é o tamanho do vetor b int *intercala(int *a, int *b, int n, int m){ int i = 0, j = 0; int *c = (int*)malloc((n…
canswered Lorenzo Moulin 76 -
3
votes1
answer164
viewsA: Save user typed equation in python
There is a Python library for algebra, the name is Sympy. It is very simple to use, in this example there, would be: from sympy import * x = Symbol('x') expr = expand(input()) num = int(input()) res…
pythonanswered Lorenzo Moulin 76 -
0
votes3
answers648
viewsA: I can’t download "pygame" or "kivy" via the "Pip install..." command
Is your Pip up to date? If not, update with the following command: Pip install --upgrade Pip. Remember to open cmd as administrator.
-
0
votes2
answers608
viewsA: Can anyone help me with this?
& (and commercial) is used to pass the address of a variable, i.e., when you do : printf("Salary receivable: %f real n",&s_final); printf("Value of taxes: %f real",&salt); the printf…