function [alpha,N,U]=youxianchafen2(r1,r2,up,under,num,deta) %[alpha,N,U]=youxianchafen2(a,r1,r2,up,under,num,deta) %该函数用有限差分法求解有两种介质的正方形区域的二维拉普拉斯方程的数值解 %函数返回迭代因子、迭代次数以及迭代完成后所求区域内网格节点处的值 %a为正方形求解区域的边长 %r1,r2分别表示两种介质的电导率 %up,under分别为上下边界值 %num表示将区域每边的网格剖分个数 %deta为迭代过程中所允许的相对误差限 n=num+1; %每边节点数 U(n,n)=0; %节点处数值矩阵 N=0; %迭代次数初值 alpha=2/(1+sin(pi/num));%超松弛迭代因子 k=r1/r2; %两介质电导率之比 U(1,1:n)=up; %求解区域上边界第一类边界条件 U(n,1:n)=under; %求解区域下边界第一类边界条件 U(2:num,1)=0;U(2:num,n)=0; for i=2:num U(i,2:num)=up-(up-under)/num*(i-1);%采用线性赋值对上下边界之间的节点赋迭代初值 end G=1; WHILE G>0 %迭代条件:不满足相对误差限要求的节点数目G不为零 Un=U; %完成第n次迭代后所有节点处的值 G=0; %每完成一次迭代将不满足相对误差限要求的节点数目归零 for j=1:n for i=2:num U1=U(i,j); %第n次迭代时网格节点处的值 if j==1 %第n+1次迭代左边界第二类边界条件 U(i,j)=1/4*(2*U(i,j+1)+U(i-1,j)+U(i+1,j)); end if (j>1)&&(j U2=1/4*(U(i,j+1)+ U(i-1,j)+ U(i,j-1)+ U(i+1,j)); U(i,j)=U1+alpha*(U2-U1); %引入超松弛迭代因子后的网格节点处的值 end if i==n+1-j %第n+1次迭代两介质分界面(与网格对角线重合)第二类边界条件 U(i,j)=1/4*(2/(1+k)*(U(i,j+1)+U(i+1,j))+2*k/(1+k)*(U(i-1,j)+U(i,j-1))); end if j==n %第n+1次迭代右边界第二类边界条件 U(i,n)=1/4*(2*U(i,j-1)+U(i-1,j)+U(i+1,j)); end end end N=N+1 %显示迭代次数 Un1=U; %完成第n+1次迭代后所有节点处的值 err=abs((Un1-Un)./Un1);%第n+1次迭代与第n次迭代所有节点值的相对误差 err(1,1:n)=0; %上边界节点相对误差置零 err(n,1:n)=0; %下边界节点相对误差置零 G=sum(sum(err>deta))%显示每次迭代后不满足相对误差限要求的节点数目G end
标签: 有限差分
上传时间: 2018-07-13
上传用户:Kemin
Reconstruction- and example-based super-resolution (SR) methods are promising for restoring a high-resolution (HR) image from low-resolution (LR) image(s). Under large magnification, reconstruction-based methods usually fail to hallucinate visual details WHILE example-based methods sometimes introduce unexpected details. Given a generic LR image, to reconstruct a photo-realistic SR image and to suppress artifacts in the reconstructed SR image, we introduce a multi-scale dictionary to a novel SR method that simultaneously integrates local and non-local priors. The local prior suppresses artifacts by using steering kernel regression to predict the target pixel from a small local area. The non-local prior enriches visual details by taking a weighted average of a large neighborhood as an estimate of the target pixel. Essentially, these two priors are complementary to each other. Experimental results demonstrate that the proposed method can produce high quality SR recovery both quantitatively and perceptually.
标签: Super-resolution Multi-scale Dictionary Single Image for
上传时间: 2019-03-28
上传用户:fullout
#include<stdio.h> #include<string.h> #include<stdlib.h> #define N 100 int iNumOfStu=0; struct score { float math; float english; float computer; }; struct student { int number; char name[20]; struct score sco; float average; }; struct student stu[N]; void print_menu(void);//输出菜单 void choosemenu(void);//菜单选择 void input_student1(int);//输入学生信息 void input_student2(void);//输入总函数 void input_student3(int &,int);//判断学号是否重复 void input_student4(int,int);//覆盖原信息 void sort_student3(student s[],int);//按照英语成绩排序 void sort_student4(student s[],int);//按照计算机成绩排序 void sort_student2(student s[],int);//按照数学成绩排序 void sort_student5(student s[],int);//按照平均成绩排序 float input_score2(int);//计算学生平均成绩 void print_student2(void);//显示表头 void print_student3(int);//显示学生信息 void print_student1(int);//显示全部学生资料 void sort_student1(void);//排序总函数 void menu(void);//菜单调度总函数 int search_student2(int);//按学号查询学生信息并输出 void search_student3(int);//按平均分最高查询并输出 void search_student1(void);//查询总函数 void delete_student2(int,int);//删除学生信息 void delete_student1(void);//删除总函数 void change_student2(int);//修改学生资料 void change_student1(void);//修改总函数 void input_score3(int);//统计成绩 void input_score1(void);//统计成绩总函数 void print_help(void);//输出帮助信息 void exit_student(void);//退出系统 void save_student(student *,int);//保存学生信息 void main() { menu(); } void save_student(student *s,int a)//保存学生信息 { FILE *fp; if((fp=fopen("d:\\学生信息.txt","wb"))==NULL) { printf("不能打开文件!\n"); } else { printf("保存信息到D盘\n"); fprintf(fp,"本班所有学生具体信息如下:\r\n"); fprintf(fp," 学号 姓名 数学成绩 英语成绩 计算机成绩 平均成绩\r\n"); for(int i=0;i<a;i++) { fprintf(fp,"%8d%12s%14.2f%14.2f%14.2f%14.2f\n",stu[i].number,stu[i].name,stu[i].sco.math,stu[i].sco.english,stu[i].sco.computer,stu[i].average); fprintf(fp,"\r\n"); } fclose(fp); printf("信息保存成功!\n"); } } void exit_student(void)//退出系统 { exit(1); } void print_help(void)//输出帮助信息 { printf("本系统所能容纳的最大学生数为%d人\n学生信息保存在D盘根目录下,保存文件为“学生信息.txt”。\n感谢使用!\n",N); } void input_score1(void)//统计成绩总函数 { int c; c=search_student2(iNumOfStu); printf("学号:%d\n",stu[c].number); printf("姓名:%s\n",stu[c].name); input_score3(c); printf("新成绩录入成功!\n"); stu[c].average=input_score2(c); } void input_score3(int a)//统计成绩 { printf("数学新成绩:"); scanf("%f",&stu[a].sco.math); printf("英语新成绩:"); scanf("%f",&stu[a].sco.english); printf("计算机新成绩:"); scanf("%f",&stu[a].sco.computer); } void change_student2(int a)//修改学生资料 { printf("学号:%d----修改为:",stu[a].number); scanf("%d",&stu[a].number); getchar(); printf("姓名:%s----修改为:",stu[a].name); gets(stu[a].name); printf("数学成绩:%.2f----修改为:",stu[a].sco.math); scanf("%f",&stu[a].sco.math); printf("英语成绩:%.2f----修改为:",stu[a].sco.english); scanf("%f",&stu[a].sco.english); printf("计算机成绩:%.2f----修改为:",stu[a].sco.computer); scanf("%f",&stu[a].sco.computer); } void change_student1(void)//修改总函数 { int c; c=search_student2(iNumOfStu); getchar(); printf("是否要修改此学生信息?(“y”代表是)"); char d; scanf("%c",&d); if(d=='y'||d=='Y') { change_student2(c); stu[c].average=input_score2(c); printf("信息修改成功!\n"); } } void delete_student1(void)//删除总函数 { int c; c=search_student2(iNumOfStu); getchar(); printf("是否删除此条记录?(“y”代表是)"); char d; scanf("%c",&d); if(d=='y'||d=='Y') { delete_student2(c,iNumOfStu); printf("记录已删除!\n"); } } void delete_student2(int a,int b)//删除学生信息 { for(int i=a;i<b-1;i++) { stu[i]=stu[i+1]; } --iNumOfStu; } void search_student1(void)//查询总函数 { printf("1、按学号查询\n2、按平均分最高查询\n请选择:"); int c; scanf("%d",&c); switch(c) { case 1: { search_student2(iNumOfStu); break; } case 2: { search_student3(iNumOfStu); break; } default: break; } } void menu(void)//菜单调度总函数 { print_menu(); choosemenu(); } void sort_student1(void)//排序总函数 { printf("1、按数学成绩排序\n2、按英语成绩排序\n3、按计算机成绩排序\n4、按平均成绩排序\n请选择:"); int c; scanf("%d",&c); switch(c) { case 1: { sort_student2(stu,iNumOfStu); break; } case 2: { sort_student3(stu,iNumOfStu); break; } case 3: { sort_student4(stu,iNumOfStu); break; } case 4: { sort_student5(stu,iNumOfStu); break; } default: break; } } void print_student1(int a)//显示全部学生资料 { printf("本班所有学生具体信息如下\n"); print_student2(); for(int i=0;i<a;i++) { print_student3(i); } } void print_student3(int a)//显示学生信息 { printf("%8d%12s%14.2f%14.2f%14.2f%14.2f\n",stu[a].number,stu[a].name,stu[a].sco.math,stu[a].sco.english,stu[a].sco.computer,stu[a].average); } void print_student2(void)//显示表头 { printf(" 学号 姓名 数学成绩 英语成绩 计算机成绩 平均成绩\n"); } void input_student4(int a,int b)//覆盖原信息 { stu[a]=stu[b-1]; --iNumOfStu; } void input_student3(int &a,int b)//判断学号是否重复 { if(a!=0) { int i=0; do { if(stu[a].number==stu[i].number) { printf("此学号代表的学生已录入\n1、覆盖原信息\n2、重新输入\n请选择:"); int c; scanf("%d",&c); switch(c) { case 1: { input_student4(i,iNumOfStu); a=iNumOfStu-1; printf("信息已替换!\n"); break; } case 2: { printf("请重新输入学生信息:\n"); input_student1(iNumOfStu-1); break; } default: break; } break; } ++i; } WHILE(i<b-1); } } void print_menu(void)//输出菜单 { printf("======欢迎来到学生信息管理系统======\n"); printf(" 1、输入学生资料\n"); printf(" 2、删除学生资料\n"); printf(" 3、查询学生资料\n"); printf(" 4、修改学生资料\n"); printf(" 5、显示学生资料\n"); printf(" 6、统计学生成绩\n"); printf(" 7、排序学生成绩\n"); printf(" 8、保存学生资料\n"); printf(" 9、获取帮助信息\n"); printf(" 10、退出系统\n"); printf("====================================\n"); printf("请选择:"); } void input_student2(void)//输入总函数 { char end; printf("请输入学生信息(在最后一个学生信息录入完成后以“/”结束录入):\n"); for(int i=0;(end=getchar())!='/';i++) { input_student1(i); ++iNumOfStu; input_student3(i,iNumOfStu); } for(int j=0;j<iNumOfStu;j++) { stu[j].average=input_score2(j); } } void input_student1(int a)//输入学生信息 { printf("学号:"); scanf("%d",&stu[a].number); getchar(); printf("姓名:"); gets(stu[a].name); printf("数学成绩:"); scanf("%f",&stu[a].sco.math); printf("英语成绩:"); scanf("%f",&stu[a].sco.english); printf("计算机成绩:"); scanf("%f",&stu[a].sco.computer); } float input_score2(int a)//计算学生平均成绩 { return (stu[a].sco.math+stu[a].sco.english+stu[a].sco.computer)/3; } void search_student3(int a)//按平均分最高查询并输出 { int max=0; for(int i=0;i<a;i++) { if(stu[max].average<stu[i].average) { max=i; } } print_student2(); print_student3(max); } void sort_student2(student s[],int a)//按照数学成绩排序 { struct student temp; for(int i=0;i<a-1;i++) { int max=i; for(int j=i+1;j<a;j++) if(stu[j].sco.math>stu[max].sco.math) { max=j; } if(max!=i) { temp=stu[max]; stu[max]=stu[i]; stu[i]=temp; } } print_student2(); for(int k=0;k<a;k++) { print_student3(k); } } void sort_student3(student s[],int a)//按照英语成绩排序 { struct student temp; for(int i=0;i<a-1;i++) { int max=i; for(int j=i+1;j<a;j++) if(stu[j].sco.english>stu[max].sco.english) { max=j; } if(max!=i) { temp=stu[max]; stu[max]=stu[i]; stu[i]=temp; } } print_student2(); for(int k=0;k<a;k++) { print_student3(k); } } void sort_student4(student s[],int a)//按照计算机成绩排序 { struct student temp; for(int i=0;i<a-1;i++) { int max=i; for(int j=i+1;j<a;j++) if(stu[j].sco.computer>stu[max].sco.computer) { max=j; } if(max!=i) { temp=stu[max]; stu[max]=stu[i]; stu[i]=temp; } } print_student2(); for(int k=0;k<a;k++) { print_student3(k); } } void sort_student5(student s[],int a)//按照平均成绩排序 { struct student temp; for(int i=0;i<a-1;i++) { int max=i; for(int j=i+1;j<a;j++) if(stu[j].average>stu[max].average) { max=j; } if(max!=i) { temp=stu[max]; stu[max]=stu[i]; stu[i]=temp; } } print_student2(); for(int k=0;k<a;k++) { print_student3(k); } } int search_student2(int a)//按照学号查找学生并输出 { int num; int c; printf("请输入要查询的学号:"); scanf("%d",&num); for(int i=0;i<a;i++) { if(num==stu[i].number) { c=i; } } printf("此学生的信息是:\n"); print_student2(); print_student3(c); return c; } void choosemenu(void)//菜单选择 { int i; scanf("%d",&i); switch(i) { case 1: { input_student2(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 2: { delete_student1(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 3: { search_student1(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 4: { change_student1(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 5: { print_student1(iNumOfStu); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 6: { input_score1(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 7: { sort_student1(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 8: { save_student(stu,iNumOfStu); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 9: { print_help(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 10: { exit_student(); } default: break; } } 运行结果: 源文件下载地址: http://115.com/file/clnq138g#一个简单的学生成绩管理系统.rar (请将此地址复制到浏览器地址栏中访问下载页面)
标签: 成绩查询系统
上传时间: 2019-06-08
上传用户:啊的撒旦
#include<stdio.h> #include<string.h> #include<stdlib.h> #define N 100 int iNumOfStu=0; struct score { float math; float english; float computer; }; struct student { int number; char name[20]; struct score sco; float average; }; struct student stu[N]; void print_menu(void);//输出菜单 void choosemenu(void);//菜单选择 void input_student1(int);//输入学生信息 void input_student2(void);//输入总函数 void input_student3(int &,int);//判断学号是否重复 void input_student4(int,int);//覆盖原信息 void sort_student3(student s[],int);//按照英语成绩排序 void sort_student4(student s[],int);//按照计算机成绩排序 void sort_student2(student s[],int);//按照数学成绩排序 void sort_student5(student s[],int);//按照平均成绩排序 float input_score2(int);//计算学生平均成绩 void print_student2(void);//显示表头 void print_student3(int);//显示学生信息 void print_student1(int);//显示全部学生资料 void sort_student1(void);//排序总函数 void menu(void);//菜单调度总函数 int search_student2(int);//按学号查询学生信息并输出 void search_student3(int);//按平均分最高查询并输出 void search_student1(void);//查询总函数 void delete_student2(int,int);//删除学生信息 void delete_student1(void);//删除总函数 void change_student2(int);//修改学生资料 void change_student1(void);//修改总函数 void input_score3(int);//统计成绩 void input_score1(void);//统计成绩总函数 void print_help(void);//输出帮助信息 void exit_student(void);//退出系统 void save_student(student *,int);//保存学生信息 void main() { menu(); } void save_student(student *s,int a)//保存学生信息 { FILE *fp; if((fp=fopen("d:\\学生信息.txt","wb"))==NULL) { printf("不能打开文件!\n"); } else { printf("保存信息到D盘\n"); fprintf(fp,"本班所有学生具体信息如下:\r\n"); fprintf(fp," 学号 姓名 数学成绩 英语成绩 计算机成绩 平均成绩\r\n"); for(int i=0;i<a;i++) { fprintf(fp,"%8d%12s%14.2f%14.2f%14.2f%14.2f\n",stu[i].number,stu[i].name,stu[i].sco.math,stu[i].sco.english,stu[i].sco.computer,stu[i].average); fprintf(fp,"\r\n"); } fclose(fp); printf("信息保存成功!\n"); } } void exit_student(void)//退出系统 { exit(1); } void print_help(void)//输出帮助信息 { printf("本系统所能容纳的最大学生数为%d人\n学生信息保存在D盘根目录下,保存文件为“学生信息.txt”。\n感谢使用!\n",N); } void input_score1(void)//统计成绩总函数 { int c; c=search_student2(iNumOfStu); printf("学号:%d\n",stu[c].number); printf("姓名:%s\n",stu[c].name); input_score3(c); printf("新成绩录入成功!\n"); stu[c].average=input_score2(c); } void input_score3(int a)//统计成绩 { printf("数学新成绩:"); scanf("%f",&stu[a].sco.math); printf("英语新成绩:"); scanf("%f",&stu[a].sco.english); printf("计算机新成绩:"); scanf("%f",&stu[a].sco.computer); } void change_student2(int a)//修改学生资料 { printf("学号:%d----修改为:",stu[a].number); scanf("%d",&stu[a].number); getchar(); printf("姓名:%s----修改为:",stu[a].name); gets(stu[a].name); printf("数学成绩:%.2f----修改为:",stu[a].sco.math); scanf("%f",&stu[a].sco.math); printf("英语成绩:%.2f----修改为:",stu[a].sco.english); scanf("%f",&stu[a].sco.english); printf("计算机成绩:%.2f----修改为:",stu[a].sco.computer); scanf("%f",&stu[a].sco.computer); } void change_student1(void)//修改总函数 { int c; c=search_student2(iNumOfStu); getchar(); printf("是否要修改此学生信息?(“y”代表是)"); char d; scanf("%c",&d); if(d=='y'||d=='Y') { change_student2(c); stu[c].average=input_score2(c); printf("信息修改成功!\n"); } } void delete_student1(void)//删除总函数 { int c; c=search_student2(iNumOfStu); getchar(); printf("是否删除此条记录?(“y”代表是)"); char d; scanf("%c",&d); if(d=='y'||d=='Y') { delete_student2(c,iNumOfStu); printf("记录已删除!\n"); } } void delete_student2(int a,int b)//删除学生信息 { for(int i=a;i<b-1;i++) { stu[i]=stu[i+1]; } --iNumOfStu; } void search_student1(void)//查询总函数 { printf("1、按学号查询\n2、按平均分最高查询\n请选择:"); int c; scanf("%d",&c); switch(c) { case 1: { search_student2(iNumOfStu); break; } case 2: { search_student3(iNumOfStu); break; } default: break; } } void menu(void)//菜单调度总函数 { print_menu(); choosemenu(); } void sort_student1(void)//排序总函数 { printf("1、按数学成绩排序\n2、按英语成绩排序\n3、按计算机成绩排序\n4、按平均成绩排序\n请选择:"); int c; scanf("%d",&c); switch(c) { case 1: { sort_student2(stu,iNumOfStu); break; } case 2: { sort_student3(stu,iNumOfStu); break; } case 3: { sort_student4(stu,iNumOfStu); break; } case 4: { sort_student5(stu,iNumOfStu); break; } default: break; } } void print_student1(int a)//显示全部学生资料 { printf("本班所有学生具体信息如下\n"); print_student2(); for(int i=0;i<a;i++) { print_student3(i); } } void print_student3(int a)//显示学生信息 { printf("%8d%12s%14.2f%14.2f%14.2f%14.2f\n",stu[a].number,stu[a].name,stu[a].sco.math,stu[a].sco.english,stu[a].sco.computer,stu[a].average); } void print_student2(void)//显示表头 { printf(" 学号 姓名 数学成绩 英语成绩 计算机成绩 平均成绩\n"); } void input_student4(int a,int b)//覆盖原信息 { stu[a]=stu[b-1]; --iNumOfStu; } void input_student3(int &a,int b)//判断学号是否重复 { if(a!=0) { int i=0; do { if(stu[a].number==stu[i].number) { printf("此学号代表的学生已录入\n1、覆盖原信息\n2、重新输入\n请选择:"); int c; scanf("%d",&c); switch(c) { case 1: { input_student4(i,iNumOfStu); a=iNumOfStu-1; printf("信息已替换!\n"); break; } case 2: { printf("请重新输入学生信息:\n"); input_student1(iNumOfStu-1); break; } default: break; } break; } ++i; } WHILE(i<b-1); } } void print_menu(void)//输出菜单 { printf("======欢迎来到学生信息管理系统======\n"); printf(" 1、输入学生资料\n"); printf(" 2、删除学生资料\n"); printf(" 3、查询学生资料\n"); printf(" 4、修改学生资料\n"); printf(" 5、显示学生资料\n"); printf(" 6、统计学生成绩\n"); printf(" 7、排序学生成绩\n"); printf(" 8、保存学生资料\n"); printf(" 9、获取帮助信息\n"); printf(" 10、退出系统\n"); printf("====================================\n"); printf("请选择:"); } void input_student2(void)//输入总函数 { char end; printf("请输入学生信息(在最后一个学生信息录入完成后以“/”结束录入):\n"); for(int i=0;(end=getchar())!='/';i++) { input_student1(i); ++iNumOfStu; input_student3(i,iNumOfStu); } for(int j=0;j<iNumOfStu;j++) { stu[j].average=input_score2(j); } } void input_student1(int a)//输入学生信息 { printf("学号:"); scanf("%d",&stu[a].number); getchar(); printf("姓名:"); gets(stu[a].name); printf("数学成绩:"); scanf("%f",&stu[a].sco.math); printf("英语成绩:"); scanf("%f",&stu[a].sco.english); printf("计算机成绩:"); scanf("%f",&stu[a].sco.computer); } float input_score2(int a)//计算学生平均成绩 { return (stu[a].sco.math+stu[a].sco.english+stu[a].sco.computer)/3; } void search_student3(int a)//按平均分最高查询并输出 { int max=0; for(int i=0;i<a;i++) { if(stu[max].average<stu[i].average) { max=i; } } print_student2(); print_student3(max); } void sort_student2(student s[],int a)//按照数学成绩排序 { struct student temp; for(int i=0;i<a-1;i++) { int max=i; for(int j=i+1;j<a;j++) if(stu[j].sco.math>stu[max].sco.math) { max=j; } if(max!=i) { temp=stu[max]; stu[max]=stu[i]; stu[i]=temp; } } print_student2(); for(int k=0;k<a;k++) { print_student3(k); } } void sort_student3(student s[],int a)//按照英语成绩排序 { struct student temp; for(int i=0;i<a-1;i++) { int max=i; for(int j=i+1;j<a;j++) if(stu[j].sco.english>stu[max].sco.english) { max=j; } if(max!=i) { temp=stu[max]; stu[max]=stu[i]; stu[i]=temp; } } print_student2(); for(int k=0;k<a;k++) { print_student3(k); } } void sort_student4(student s[],int a)//按照计算机成绩排序 { struct student temp; for(int i=0;i<a-1;i++) { int max=i; for(int j=i+1;j<a;j++) if(stu[j].sco.computer>stu[max].sco.computer) { max=j; } if(max!=i) { temp=stu[max]; stu[max]=stu[i]; stu[i]=temp; } } print_student2(); for(int k=0;k<a;k++) { print_student3(k); } } void sort_student5(student s[],int a)//按照平均成绩排序 { struct student temp; for(int i=0;i<a-1;i++) { int max=i; for(int j=i+1;j<a;j++) if(stu[j].average>stu[max].average) { max=j; } if(max!=i) { temp=stu[max]; stu[max]=stu[i]; stu[i]=temp; } } print_student2(); for(int k=0;k<a;k++) { print_student3(k); } } int search_student2(int a)//按照学号查找学生并输出 { int num; int c; printf("请输入要查询的学号:"); scanf("%d",&num); for(int i=0;i<a;i++) { if(num==stu[i].number) { c=i; } } printf("此学生的信息是:\n"); print_student2(); print_student3(c); return c; } void choosemenu(void)//菜单选择 { int i; scanf("%d",&i); switch(i) { case 1: { input_student2(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 2: { delete_student1(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 3: { search_student1(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 4: { change_student1(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 5: { print_student1(iNumOfStu); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 6: { input_score1(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 7: { sort_student1(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 8: { save_student(stu,iNumOfStu); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 9: { print_help(); printf("按回车键返回主菜单"); getchar(); getchar(); menu(); break; } case 10: { exit_student(); } default: break; } } 运行结果: 源文件下载地址: http://115.com/file/clnq138g#一个简单的学生成绩管理系统.rar (请将此地址复制到浏览器地址栏中访问下载页面) #include<stdio.h> #include<string.h> #include<stdlib.h> #define N 100 int iNumOfStu=0; struct score { float math; float english; float computer; }; struct student { int number; char name[20]; struct score sco; float average; }; struct student stu[N]; void print_menu(void);//输出菜单 void choosemenu(void);//菜单选择 void input_student1(int);//输入学生信息 void input_student2(void);//输入总函数 void input_student3(int &,int);//判断学号是否重复 void input_student4(int,int);//覆盖原信息 void sort_student3(student s[],int);//按照英语成绩排序 void sort_student4(student s[],int);//按照计算机成绩排序 void sort_student2(student s[],int);//按照数学成绩排序 void sort_student5(student s[],int);//按照平均成绩排序 float input_score2(int);//计算学生平均成绩 void print_student2(void);//显示表头 void print_student3(int);//显示学生信息 void print_student1(int);//显示全部学生资料 void sort_student1(void);//排序总函数 void menu(void);//菜单调度总函数 int search_student2(int);//按学号查询学生信息并输出 void search_student3(int);//按平均分最高查询并输出 void search_student1(void);//查询总函数 void delete_student2(int,int);//删除学生信息 void delete_student1(void);//删除总函数 void change_student2(int);//修改学生资料 void change_student1(void);//修改总函数 void input_score3(int);//统计成绩 void input_score1(void);//统计成绩总函数 void print_help(void);//输出帮助信息 void exit_student(void);//退出系统 void save_student(student *,int);//保存学生信息 void main() { menu(); } void save_student(student *s,int a)//保存学生信息 { FILE *fp; if((fp=fopen("d:\\学生信息.txt","wb"))==NULL) { printf("不能打开文件!\n"); } else { printf("保存信息到D盘\n"); fprintf(fp,"本班所有学生具体信息如下:\r\n"); fprintf(fp," 学号 姓名 数学成绩 英语成绩 计算机成绩 平均成绩\r\n"); for(int i=0;i<a;i++) { fprintf(fp,"%8d%12s%14.2f%14.2f%14.2f%14.2f\n",stu[i].number,stu[i].name,stu[i].sco.math,stu[i].sco.english,stu[i].sco.computer,stu[i].average); fprintf(fp,"\r\n"); } fclose(fp); printf("信息保存成功!\n"); } } void exit_student(void)//退出系统 { exit(1); } void print_help(void)//输出帮助信息 { printf("本系统所能容纳的最大学生数为%d人\n学生信息保存在D盘根目录下,保存文件为“学生信息.txt”。\n感谢使用!\n",N); } void input_score1(void)//统计成绩总函数 { int c; c=search_student2(iNumOfStu); printf("学号:%d\n",stu[c].number); printf("姓名:%s\n",stu[c].name); input_score3(c); printf("新成绩录入成功!
标签: c语言
上传时间: 2019-06-09
上传用户:啊的撒旦
High-Speed, Low-Power Dual Operational Amplifier The AD826 features high output current drive capability of 50 mA min per amp, and is able to drive unlimited capacitive loads. With a low power supply current of 15 mA max for both amplifiers, the AD826 is a true general purpose operational amplifier. The AD826 is ideal for power sensitive applications such as video cameras and portable instrumentation. The AD826 can operate from a single +5 V supply, WHILE still achieving 25 MHz of band width. Furthermore the AD826 is fully specified from a single +5 V to ±15 V power supplies. The AD826 excels as an ADC/DAC buffer or active filter in data acquisition systems and achieves a settling time of 70 ns to 0.01%, with a low input offset voltage of 2 mV max. The AD826 is available in small 8-lead plastic mini-DIP and SO packages.
上传时间: 2020-04-19
上传用户:su1254
PRODUCT DESCRIPTION The AD810 is a composite and HDTV compatible, current feedback, video operational amplifier, ideal for use in systems such as multimedia, digital tape recorders and video cameras. The 0.1 dB flatness specification at bandwidth of 30 MHz (G = +2) and the differential gain and phase of 0.02% and 0.04° (NTSC) make the AD810 ideal for any broadcast quality video system. All these specifications are under load conditions of 150 Ω (one 75 Ω back terminated cable). The AD810 is ideal for power sensitive applications such as video cameras, offering a low power supply current of 8.0 mA max. The disable feature reduces the power supply current to only 2.1 mA, WHILE the amplifier is not in use, to conserve power. Furthermore the AD810 is specified over a power supply range of ±5 V to ±15 V.
上传时间: 2020-04-19
上传用户:su1254
transimpedance linearization circuitry. This allows it to drive video loads with excellent differential gain and phase perfor mance on only 50 mW of power. The AD8001 is a current feedback amplifier and features gain flatness of 0.1 dB to 100 MHz WHILE offering differential gain and phase error of 0.01% and 0.025°. This makes the AD8001 ideal for professional video electronics such as cameras and video switchers. Additionally, the AD8001’s low distortion and fast settling make it ideal for buffer high-speed A-to-D converters. The AD8001 offers low power of 5.5 mA max (VS = ±5 V) and can run on a single +12 V power supply, WHILE being capable of delivering over 70 mA of load current. These features make this amplifier ideal for portable and battery-powered applications where size and power are critical. The outstanding bandwidth of 800 MHz along with 1200 V/µs of slew rate make the AD8001 useful in many general purpose high-speed applications where dual power supplies of up to ±6 V and single supplies from 6 V to 12 V are needed. The AD8001 is available in the industrial temperature range of –40°C to +85°C.
上传时间: 2020-04-21
上传用户:su1254
The contemporary view of the Smart City is very much static and infrastructure- centric, focusing on installation and subsequent management of Edge devices and analytics of data provided by these devices. WHILE this still allows a more efficient management of the city’s infrastructure, optimizations and savings in different do- mains, the existing architectures are currently designed as single-purpose, vertically siloed solutions. This hinders active involvement of a variety of stakeholders (e.g., citizens and businesses) who naturally form part of the city’s ecosystem and have an inherent interest in jointly coordinating and influencing city-level activities.
标签: Internet Systems Cities People Things Smart The and of
上传时间: 2020-05-26
上传用户:shancjb
In recent years, cellular voice networks have transformed into powerful packet-switched access networks for both voice communication and Internet access. Evolving Universal Mobile Telecommunication System (UMTS) networks and first Long Term Evolution (LTE) installations now deliver bandwidths of several megabits per second to individual users, and mobile access to the Internet from handheld devices and notebooks is no longer perceived as slower than a Digital Subscriber Line (DSL) or cable connection. Bandwidth and capacity demands, however, keep rising because of the increasing number of people using the networks and because of bandwidth-intensive applications such as video streaming. Thus, network manufacturers and network operators need to find ways to continuously increase the capacity and performance of their cellular networks WHILE reducing the cost.
标签: BRINGING NETWORKS Beyond and 3G 4G
上传时间: 2020-05-26
上传用户:shancjb
From the transition of analog to digital communication along with seamless mobility and high computing power of small handheld devices, the wireless communications industry has seen tremendous changes leading to the integration of several telecommunication networks, devices and services over last 30 years. The rate of this progress and growth has increased particularly in the past decade because people no longer use their devices and networks for voice only, but demand bundle contents such as data download/streaming, HDTV, HD video , 3D video conferencing with higher efficiency, seamless connectivity, intelligence, reliability and better user experience. Although the challenges facing service providers and telecommunication companies differ by product, region, market size, and their areas of concentration but time to market, efficient utilization of their assets and revenue expansion, have impacted significantly how to manage and conduct their business WHILE maintaining sufficient margin.
标签: Convergence Networks Beyond 4G of
上传时间: 2020-05-26
上传用户:shancjb