Posts by fernanda • 125 points
11 posts
-
0
votes1
answer394
viewsQ: dynamic matrix allocation within a struct
statement and code: Make a program that stores movies produced by various directors and: - Create and read a vector of 5 directors, each containing name (maximum 20 letters), number of movies and…
-
0
votes3
answers176
viewsQ: Dynamic allocation with a void function
I made a simple code using dynamic allocation. Just ask for the vector size, to insert data and print them at the end I can make dynamic allocation with int, returning the vet, but as I’m learning,…
-
0
votes1
answer93
viewsQ: Why can’t I print it?
It’s a simple code (I’m practicing pointers) It is not printing the result, the program closes... because? ;-; #include <stdio.h> #include <math.h> #define PI 3.1416 void…
-
1
votes3
answers497
viewsQ: Char pointer in printf() does not work
I decided to make this code simple, where I have an empty vector and a function that fills it only with a letter that the user type, but I’m not able to print. If I wear that printf() commented, it…
-
1
votes2
answers1393
viewsQ: Loop problem with switch case
I reread the code following the guidelines given here. However, it has had the initial problem again... I choose the desired option, it performs the desired action but soon after it goes to the…
-
0
votes0
answers63
viewsQ: Generate a matrix without repetitions
I need to make a code that takes an array and puts random numbers on it, no repetitions. I am able to generate the matrix, however, it still has some repeated numbers ;-; #include <stdio.h>…
-
1
votes2
answers209
viewsQ: Why isn’t the break working?
Enunciation: Read a 5x5 matrix. Also read an X value. The program should do a search for this value in the matrix and, at the end, write the location (row and column) or "not found) message" Code:…
-
0
votes1
answer1505
viewsQ: Vector union, no repetitions in C
Follows the statement: Read two integer vectors X and Y, cadao one with 5 elements (assume the user does not report repeated elements). Calculate and show the resulting vectors in each case below:…
-
0
votes2
answers514
viewsQ: How to have two counters in the same loop?
I have the following structure in my code: for c in range(0, len(str(ListaTemp[4]))): for c2 in range(c+1, len(str(ListaTemp[4]))): if str(num)[c] == str(num)[c2]: valido = True And so. My teacher…
-
2
votes1
answer642
viewsQ: Return the largest number in Python with recursion
My teacher started talking about recursion, and passed a few exercises, only I stalled on a. As stated in the following statement, I must create a function that returns the highest value contained…
-
0
votes2
answers90
viewsQ: sort list c lambda
alfabeto = {'t':0, 's':1, 'h':2, 'j':3, 'm':4, 'p':5, 'n':6, 'z':7, 'w':8, 'l':9, 'r':10, ' c':11, 'b':12, 'x':13, 'k':14, 'q':15, 'v':16, 'd':17, 'g':18, 'f':19} d = open('txtA.txt', 'r') ordenar =…
classificationasked fernanda 125