Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
야
야오지앙_ITE1015_2019021503
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
야오지앙
야오지앙_ITE1015_2019021503
Commits
b5e2cdb3
Commit
b5e2cdb3
authored
Sep 20, 2022
by
야오지앙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
2e5f664b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
2-1-1.c
2-1-1.c
+36
-0
No files found.
2-1-1.c
0 → 100644
View file @
b5e2cdb3
#include<stdio.h>
#include<windows.h>
#include<string.h>
struct
Person
{
char
name
[
20
];
int
age
;
}
student
[
3
]
=
{
"Steve"
,
22
,
"Allen"
,
20
,
"Sun"
,
25
};
int
main
()
{
int
i
=
0
,
j
=
0
;
char
student_name
[
20
];
for
(
i
=
0
;
i
<
3
;
i
++
)
{
printf
(
"please input the name of student:
\n
"
);
gets_s
(
student_name
,
20
);
for
(
j
=
0
;
j
<
3
;
j
++
)
{
if
((
strcmp
(
student_name
,
student
[
j
].
name
)
==
0
))
{
student
[
j
].
age
++
;
}
}
}
printf
(
"
\n
Result:
\n
"
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
printf
(
"%5s:%d
\n
"
,
student
[
i
].
name
,
student
[
i
].
age
);
}
system
(
"pause"
);
return
0
;
}
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