Posts by Renan • 171 points
18 posts
-
1
votes0
answers60
viewsQ: Error in output file
In an exercise, I need to read an input file as follows: # add # Jabuticaba # Fruto de jabuticabeira. Jabuticabeira. # add # Vacilar # Não estar firme. Cambalear. Oscilar. Tremer. # add # Jacapa #…
-
2
votes0
answers5015
viewsQ: Undefined Reference to
I have a program that’s divided into your main, city.c and city.h. Main: #include "city.h" int main() { FILE *entrada; FILE *saida; Cidade *cidades; entrada = fopen("entrada.c", "r"); int…
-
0
votes0
answers32
viewsQ: Reference passage
In an exercise, I need to compare a certain number of distances and tell which are the smallest and print them out. For this, I have the following function: void Permuta(FILE *saida, Cidade *C, int…
-
0
votes1
answer44
viewsQ: Printing the shortest distances
The exercise asks me to print the smallest routes between n cities, whereas the latter is the same city as the starting point. First, I need to read an input file like the following: 5 1 10 4 4 5 1…
-
0
votes0
answers70
viewsQ: Calculate all distances
In an exercise, I need to calculate all distances between coordinate points (x,y) which are read from a file, the last point of which coincides with the first. Each point represents a city that is…
-
1
votes0
answers71
viewsQ: Doubt in the printing of results
The exercise asks me to print, in a file, all possible paths between n cities, where the end is always the starting point and each city is represented as coordinates (x,y). That first part I managed…
-
3
votes0
answers848
viewsQ: Calculate the shortest possible distance
In an exercise, I need to print all possible paths between cities, and cities are represented by coordinates x and y and that the last city is the city of departure. Remembering that should be found…
-
0
votes1
answer84
viewsQ: Generate all possible paths
In an exercise, I need to print, in a file, all the trajectory possibilities between a number N of cities, each city being represented by coordinates x and y and that the last city should be the…
-
1
votes1
answer82
viewsQ: Reading only odd records
Initially, I had to create a program to save data from a struct to a file. The struct is as follows:: typedef struct { char nome[30]; int matricula; char conceito; } TipoAluno; I made the program in…
-
1
votes2
answers363
viewsQ: File reading
I need to read from a file the amount of tests to be done and which tests to be done. The input file is as follows: 4 //Numero de testes a serem feitos 1 LINSIMP 3 //Primeiro(1) teste que verifica…
-
1
votes1
answer59
viewsQ: Error in reading file
I need to create functions that read from an.txt input file: Number of points Coordinates of the points Number of lines Number of vertices of each line Coordinates of each vertex of the line…
-
1
votes3
answers1242
viewsQ: Point inside a polygon
I need to create a function that checks if a point is inside a polygon. For this, I researched on the Internet some solutions that can help me. I found one that seems to be of great help, but in one…
-
0
votes1
answer41
viewsQ: Function for matching points
In an exercise, I need to create a function that returns TRUE if the points are identical. For the points, a structure was implemented as follows: typedef struct //Estrutura definida para os pontos.…
-
2
votes1
answer4013
viewsQ: Binary file storage
In the program, I need to implement a structure that represents a student (name, age and enrollment). Using this structure, I have to write a program that reads the data of 5 students and stores it…
-
0
votes1
answer763
viewsQ: Warnings when compiling the program
In the code below, I need to create a structure for Point (Coordinate x and y) and create a function that creates these points using pointers. The structure was made as follows: typedef struct…
-
1
votes1
answer264
viewsQ: C - Structures for point, polygonal line and polygon
Good night The exercise asks me to implement three structs: Point (coordinates X and Y), polygonal lines (sequence of 2 to 100 points that are the vertices along the line) and polygon (sequence of 3…
-
1
votes1
answer92
viewsQ: Make a drawing as user input
The exercise asks the program to receive an integer n and print a height drawing 2*n as follows: \ * / \ *** / \*****/ \***/ \*/ /*\ /***\ /*****\ / *** \ / * \ I did the following until the moment:…
-
0
votes2
answers1435
viewsQ: C - Print the N-esimo prime number
The exercise asks the program to read an N number and print the N-esimo given prime number. Ex: I enter N = 3. The program will have to print The third prime number, which is 5. Other examples:…