function [alpha,N,U]=youxianchafen2(r1,r2,up,under,num,deta) %[alpha,N,U]=youxianchafen2(a,r1,r2,up,under,num,deta) %該函數(shù)用有限差分法求解有兩種介質(zhì)的正方形區(qū)域的二維拉普拉斯方程的數(shù)值解 %函數(shù)返回迭代因子、迭代次數(shù)以及迭代完成后所求區(qū)域內(nèi)網(wǎng)格節(jié)點處的值 %a為正方形求解區(qū)域的邊長 %r1,r2分別表示兩種介質(zhì)的電導率 %up,under分別為上下邊界值 %num表示將區(qū)域每邊的網(wǎng)格剖分個數(shù) %deta為迭代過程中所允許的相對誤差限 n=num+1; %每邊節(jié)點數(shù) U(n,n)=0; %節(jié)點處數(shù)值矩陣 N=0; %迭代次數(shù)初值 alpha=2/(1+sin(pi/num));%超松弛迭代因子 k=r1/r2; %兩介質(zhì)電導率之比 U(1,1:n)=up; %求解區(qū)域上邊界第一類邊界條件 U(n,1:n)=under; %求解區(qū)域下邊界第一類邊界條件 U(2:num,1)=0;U(2:num,n)=0; for i=2:num U(i,2:num)=up-(up-under)/num*(i-1);%采用線性賦值對上下邊界之間的節(jié)點賦迭代初值 end G=1; while G>0 %迭代條件:不滿足相對誤差限要求的節(jié)點數(shù)目G不為零 Un=U; %完成第n次迭代后所有節(jié)點處的值 G=0; %每完成一次迭代將不滿足相對誤差限要求的節(jié)點數(shù)目歸零 for j=1:n for i=2:num U1=U(i,j); %第n次迭代時網(wǎng)格節(jié)點處的值 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); %引入超松弛迭代因子后的網(wǎng)格節(jié)點處的值 end if i==n+1-j %第n+1次迭代兩介質(zhì)分界面(與網(wǎng)格對角線重合)第二類邊界條件 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 %顯示迭代次數(shù) Un1=U; %完成第n+1次迭代后所有節(jié)點處的值 err=abs((Un1-Un)./Un1);%第n+1次迭代與第n次迭代所有節(jié)點值的相對誤差 err(1,1:n)=0; %上邊界節(jié)點相對誤差置零 err(n,1:n)=0; %下邊界節(jié)點相對誤差置零 G=sum(sum(err>deta))%顯示每次迭代后不滿足相對誤差限要求的節(jié)點數(shù)目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);//輸入總函數(shù) 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);//按照數(shù)學成績排序 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);//排序總函數(shù) void menu(void);//菜單調(diào)度總函數(shù) int search_student2(int);//按學號查詢學生信息并輸出 void search_student3(int);//按平均分最高查詢并輸出 void search_student1(void);//查詢總函數(shù) void delete_student2(int,int);//刪除學生信息 void delete_student1(void);//刪除總函數(shù) void change_student2(int);//修改學生資料 void change_student1(void);//修改總函數(shù) void input_score3(int);//統(tǒng)計成績 void input_score1(void);//統(tǒng)計成績總函數(shù) void print_help(void);//輸出幫助信息 void exit_student(void);//退出系統(tǒng) 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," 學號 姓名 數(shù)學成績 英語成績 計算機成績 平均成績\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)//退出系統(tǒng) { exit(1); } void print_help(void)//輸出幫助信息 { printf("本系統(tǒng)所能容納的最大學生數(shù)為%d人\n學生信息保存在D盤根目錄下,保存文件為“學生信息.txt”。\n感謝使用!\n",N); } void input_score1(void)//統(tǒng)計成績總函數(shù) { 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)//統(tǒng)計成績 { printf("數(shù)學新成績:"); 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("數(shù)學成績:%.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)//修改總函數(shù) { 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)//刪除總函數(shù) { 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)//查詢總函數(shù) { 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)//菜單調(diào)度總函數(shù) { print_menu(); choosemenu(); } void sort_student1(void)//排序總函數(shù) { printf("1、按數(shù)學成績排序\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(" 學號 姓名 數(shù)學成績 英語成績 計算機成績 平均成績\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("======歡迎來到學生信息管理系統(tǒng)======\n"); printf(" 1、輸入學生資料\n"); printf(" 2、刪除學生資料\n"); printf(" 3、查詢學生資料\n"); printf(" 4、修改學生資料\n"); printf(" 5、顯示學生資料\n"); printf(" 6、統(tǒng)計學生成績\n"); printf(" 7、排序?qū)W生成績\n"); printf(" 8、保存學生資料\n"); printf(" 9、獲取幫助信息\n"); printf(" 10、退出系統(tǒng)\n"); printf("====================================\n"); printf("請選擇:"); } void input_student2(void)//輸入總函數(shù) { char end; printf("請輸入學生信息(在最后一個學生信息錄入完成后以“/”結(jié)束錄入):\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("數(shù)學成績:"); 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)//按照數(shù)學成績排序 { 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; } } 運行結(jié)果: 源文件下載地址: http://115.com/file/clnq138g#一個簡單的學生成績管理系統(tǒng).rar (請將此地址復制到瀏覽器地址欄中訪問下載頁面)
標簽: 成績查詢系統(tǒng)
上傳時間: 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);//輸入總函數(shù) 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);//按照數(shù)學成績排序 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);//排序總函數(shù) void menu(void);//菜單調(diào)度總函數(shù) int search_student2(int);//按學號查詢學生信息并輸出 void search_student3(int);//按平均分最高查詢并輸出 void search_student1(void);//查詢總函數(shù) void delete_student2(int,int);//刪除學生信息 void delete_student1(void);//刪除總函數(shù) void change_student2(int);//修改學生資料 void change_student1(void);//修改總函數(shù) void input_score3(int);//統(tǒng)計成績 void input_score1(void);//統(tǒng)計成績總函數(shù) void print_help(void);//輸出幫助信息 void exit_student(void);//退出系統(tǒng) 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," 學號 姓名 數(shù)學成績 英語成績 計算機成績 平均成績\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)//退出系統(tǒng) { exit(1); } void print_help(void)//輸出幫助信息 { printf("本系統(tǒng)所能容納的最大學生數(shù)為%d人\n學生信息保存在D盤根目錄下,保存文件為“學生信息.txt”。\n感謝使用!\n",N); } void input_score1(void)//統(tǒng)計成績總函數(shù) { 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)//統(tǒng)計成績 { printf("數(shù)學新成績:"); 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("數(shù)學成績:%.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)//修改總函數(shù) { 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)//刪除總函數(shù) { 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)//查詢總函數(shù) { 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)//菜單調(diào)度總函數(shù) { print_menu(); choosemenu(); } void sort_student1(void)//排序總函數(shù) { printf("1、按數(shù)學成績排序\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(" 學號 姓名 數(shù)學成績 英語成績 計算機成績 平均成績\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("======歡迎來到學生信息管理系統(tǒng)======\n"); printf(" 1、輸入學生資料\n"); printf(" 2、刪除學生資料\n"); printf(" 3、查詢學生資料\n"); printf(" 4、修改學生資料\n"); printf(" 5、顯示學生資料\n"); printf(" 6、統(tǒng)計學生成績\n"); printf(" 7、排序?qū)W生成績\n"); printf(" 8、保存學生資料\n"); printf(" 9、獲取幫助信息\n"); printf(" 10、退出系統(tǒng)\n"); printf("====================================\n"); printf("請選擇:"); } void input_student2(void)//輸入總函數(shù) { char end; printf("請輸入學生信息(在最后一個學生信息錄入完成后以“/”結(jié)束錄入):\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("數(shù)學成績:"); 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)//按照數(shù)學成績排序 { 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; } } 運行結(jié)果: 源文件下載地址: http://115.com/file/clnq138g#一個簡單的學生成績管理系統(tǒng).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);//輸入總函數(shù) 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);//按照數(shù)學成績排序 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);//排序總函數(shù) void menu(void);//菜單調(diào)度總函數(shù) int search_student2(int);//按學號查詢學生信息并輸出 void search_student3(int);//按平均分最高查詢并輸出 void search_student1(void);//查詢總函數(shù) void delete_student2(int,int);//刪除學生信息 void delete_student1(void);//刪除總函數(shù) void change_student2(int);//修改學生資料 void change_student1(void);//修改總函數(shù) void input_score3(int);//統(tǒng)計成績 void input_score1(void);//統(tǒng)計成績總函數(shù) void print_help(void);//輸出幫助信息 void exit_student(void);//退出系統(tǒng) 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," 學號 姓名 數(shù)學成績 英語成績 計算機成績 平均成績\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)//退出系統(tǒng) { exit(1); } void print_help(void)//輸出幫助信息 { printf("本系統(tǒng)所能容納的最大學生數(shù)為%d人\n學生信息保存在D盤根目錄下,保存文件為“學生信息.txt”。\n感謝使用!\n",N); } void input_score1(void)//統(tǒng)計成績總函數(shù) { 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
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1