未命名1

此博客展示了一段C语言代码,实现学生信息管理。定义了学生结构体,包含姓名、年龄、ID和性别。主函数通过循环根据用户输入执行不同操作,如输入学生信息、打印学生信息、按ID搜索学生信息。

#include<stdio.h>
#include<string.h>
struct student{
char name[100];
int age;
int id;
char sex[100];
}s[10];
int k=0;
int main()
{
void input_student();
void print_student();
void search_student(int id);
int n;
while(scanf("%d",&n)!=EOF){
if(n1){
input_student();
}else if(n
2){
print_student();
}else if(n3){
int id;
scanf("%d",&id);
search_student(id);
}
}
return 0;
}
void input_student(){
scanf("%d %d %s %s",&s[k].id,&s[k].age,s[k].name,s[k].sex);
k++;
}
void print_student(){
for(int i=0;i<k;i++){
printf("%d %d %s %s",s[k].id,s[k].age,s[k].name,s[k].sex);
}
}
void search_student(int id){
for(int i=0;i<k;i++){
if(s[i].id
id){
printf("%d %d %s %s",s[k].id,s[k].age,s[k].name,s[k].sex);
break;
}
}
}

c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 26102 (\N{CJK UNIFIED IDEOGRAPH-65F6}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 38388 (\N{CJK UNIFIED IDEOGRAPH-95F4}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 27493 (\N{CJK UNIFIED IDEOGRAPH-6B65}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 24635 (\N{CJK UNIFIED IDEOGRAPH-603B}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 21151 (\N{CJK UNIFIED IDEOGRAPH-529F}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 29575 (\N{CJK UNIFIED IDEOGRAPH-7387}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 20027 (\N{CJK UNIFIED IDEOGRAPH-4E3B}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 36724 (\N{CJK UNIFIED IDEOGRAPH-8F74}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 22612 (\N{CJK UNIFIED IDEOGRAPH-5854}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 26550 (\N{CJK UNIFIED IDEOGRAPH-67B6}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 21152 (\N{CJK UNIFIED IDEOGRAPH-52A0}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 26435 (\N{CJK UNIFIED IDEOGRAPH-6743}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 25439 (\N{CJK UNIFIED IDEOGRAPH-635F}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 20260 (\N{CJK UNIFIED IDEOGRAPH-4F24}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 20248 (\N{CJK UNIFIED IDEOGRAPH-4F18}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 21270 (\N{CJK UNIFIED IDEOGRAPH-5316}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 21069 (\N{CJK UNIFIED IDEOGRAPH-524D}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 21518 (\N{CJK UNIFIED IDEOGRAPH-540E}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 32422 (\N{CJK UNIFIED IDEOGRAPH-7EA6}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 26463 (\N{CJK UNIFIED IDEOGRAPH-675F}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 26465 (\N{CJK UNIFIED IDEOGRAPH-6761}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 20214 (\N{CJK UNIFIED IDEOGRAPH-4EF6}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 19981 (\N{CJK UNIFIED IDEOGRAPH-4E0D}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 28385 (\N{CJK UNIFIED IDEOGRAPH-6EE1}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:178: UserWarning: Glyph 36275 (\N{CJK UNIFIED IDEOGRAPH-8DB3}) missing from font(s) DejaVu Sans. plt.tight_layout() c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 26102 (\N{CJK UNIFIED IDEOGRAPH-65F6}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 38388 (\N{CJK UNIFIED IDEOGRAPH-95F4}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 27493 (\N{CJK UNIFIED IDEOGRAPH-6B65}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 24635 (\N{CJK UNIFIED IDEOGRAPH-603B}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 21151 (\N{CJK UNIFIED IDEOGRAPH-529F}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 29575 (\N{CJK UNIFIED IDEOGRAPH-7387}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 20027 (\N{CJK UNIFIED IDEOGRAPH-4E3B}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 36724 (\N{CJK UNIFIED IDEOGRAPH-8F74}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 22612 (\N{CJK UNIFIED IDEOGRAPH-5854}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 26550 (\N{CJK UNIFIED IDEOGRAPH-67B6}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 21152 (\N{CJK UNIFIED IDEOGRAPH-52A0}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 26435 (\N{CJK UNIFIED IDEOGRAPH-6743}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 25439 (\N{CJK UNIFIED IDEOGRAPH-635F}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 20260 (\N{CJK UNIFIED IDEOGRAPH-4F24}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 20248 (\N{CJK UNIFIED IDEOGRAPH-4F18}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 21270 (\N{CJK UNIFIED IDEOGRAPH-5316}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 21069 (\N{CJK UNIFIED IDEOGRAPH-524D}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 21518 (\N{CJK UNIFIED IDEOGRAPH-540E}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 32422 (\N{CJK UNIFIED IDEOGRAPH-7EA6}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 26463 (\N{CJK UNIFIED IDEOGRAPH-675F}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 26465 (\N{CJK UNIFIED IDEOGRAPH-6761}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 20214 (\N{CJK UNIFIED IDEOGRAPH-4EF6}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 19981 (\N{CJK UNIFIED IDEOGRAPH-4E0D}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 28385 (\N{CJK UNIFIED IDEOGRAPH-6EE1}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') c:\users\1\desktop\未命名1.py:212: UserWarning: Glyph 36275 (\N{CJK UNIFIED IDEOGRAPH-8DB3}) missing from font(s) DejaVu Sans. ani.save('real_time_optimization.gif', writer='pillow') 优化完成,结果已保存至 优化后的功率分配_问题三加权损伤.xlsx
07-18
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值