Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
jobrod
/
HW1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
099df1b2
authored
4 days ago
by
jobrod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
d608c140
master
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
HW1Algorithm.txt
HW1Algorithm.txt
0 → 100644
View file @
099df1b2
Algorithm:
Define Structures:
Define the Student structure with attributes: student_code, name, and id_code.
Define the Resident structure with attributes: id_code and city.
Read Data from Files:
Read data from F1.txt and store it in an array of Student structures.
Read data from F2.txt and store it in an array of Resident structures.
User Input:
Prompt the user to input a string Residence.
Match Students:
Iterate through the list of students and residents.
For each student, check if their id_code matches the id_code of any resident with the given Residence.
If a match is found, add the student to the list of matching students.
Output Results:
Check if there are any matching students.
If there are matching students, print their details (Student Code, Name, ID Code).
If no matching students are found, print a message indicating that no students were found with the given residence.
Program Termination:
After printing the results, terminate the program.
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment