当前位置:网站首页>Personal information management system
Personal information management system
2022-07-19 06:53:00 【winkiii】
describe
Xiao Zhang is the head of the homecoming Association , But the complicated contact information gave him a headache , Please help him write a personal mailbox management system ( The number of people is less than 30 people ), Everyone contains 3 Item information :
full name ( Less than 20 Characters ) Gender (Female = Woman , Male = male ) Birthday ( Specific date )
Each person is represented by a structure , At the same time, the following operations are supported :
add Tim Male 1993 12 22
Add a name Tim Of boys , Date of birth 1993-12-22
name Tim
Return name as Tim All the information about the people
sex Male
Return the information of all boys (sex Female Return the girl information )
quit
Exit the system
Input
User instructions
Output
Output results
sample input 1
add Tim Male 1993 12 22
add Britney Female 1992 2 23
add Freddy Male 1989 4 22
name Britney
sex Male
quit
sample output 1
Britney Female 1992-2-23
Tim Male 1993-12-22
Freddy Male 1989-4-22
#include<string.h>
#include<stdio.h>
struct{
char name[100];
char sex[10];
int year;
int month;
int day;
}stu[30];
int main(){
char s[10];
int i=0;
while(1)
{
scanf("%s",s);
if(strcmp(s,"quit")==0){
break;
}
if(strcmp(s,"add")==0){
scanf("%s%s%d%d%d",&stu[i].name,&stu[i].sex,&stu[i].year,&stu[i].month,&stu[i].day);
i++;
}
if(strcmp(s,"name")==0){
char b[100];
scanf("%s",b);
for(int j=0;j<i;j++){
if(strcmp(b,stu[j].name)==0){
printf("%s %s %d-%d-%d\n",stu[j].name,stu[j].sex,stu[j].year,stu[j].month,stu[j].day);
}
}
}
if(strcmp(s,"sex")==0){
char a[10];
scanf("%s",a);
for(int j=0;j<i;j++){
if(strcmp(a,stu[j].sex)==0){
printf("%s %s %d-%d-%d\n",stu[j].name,stu[j].sex,stu[j].year,stu[j].month,stu[j].day);
}
}
}
}
}
边栏推荐
猜你喜欢

Pytorch deep learning practice-b station Liu erden-day6

Common user password encryption methods and cracking methods

Pytorch deep learning practice-b station Liu erden-day3

常见的用户密码加密方式以及破解方法

Slag learning road (2) pure white direction: win Server 2003 server building
![[jmeter] TCP Sampler](/img/ac/3b08db8808d84eb144262d78880050.png)
[jmeter] TCP Sampler

管理员阻止运行此应用

notepad++下划线以及大小写字母置换

2022-7-15 cheap domestic PLC industrial control board with scattered records of 485 master-slave communication

高并发day02(Concurrent包)
随机推荐
开发板训练:STM32下的多任务程序
个人信息管理系统
【自动化测试】——robotframework实战(三)编写测试用例
FreeBSD 12 国内源提速 pkg 和 ports 做个笔记
STM32 serial communication related learning
STM32串口通信相关学习
Wu Enda machine learning chapter 1-2
管理员阻止运行此应用
top命令
Restapi implementation of automatic completion & case implementation (search box input for automatic completion)
TCP/IP四层模型以及F5部分相关配置
Release nohup Out disk space occupied
Gentoo安装教程(Systemd+Gnome)
总价合同、成本补偿合同、工料合同
How to make good use of cost compensation contract in government procurement
Wu Enda machine learning chapter 8-9
勒索病毒防护浅谈
Freebsd 12 安装RPM包
阿拉伯数字转中文
linxu下调试微信调一跳(Fedora 27)