#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
上傳用戶:啊的撒旦
%========================開始提取加噪信號的各類特征值================================ for n=1:1:50; m=n*Ns; x=(n-1)*Ns; for i=x+1:m; %提取加噪信號'signal_with_noise=y+noise'的前256個元素,抽取50次 y0(i)=signal_with_noise(i); end Y=fft(y0); %對調制信號進行快速傅里葉算法(離散) y1=hilbert(y0) ; %調制信號實部的解析式 factor=0; %開始求零中心歸一化瞬時幅度譜密度的最大值gamma_max for i=x+1:m; factor=factor+y0(i); end ms=factor/(m-x); an_i=y0./ms; acn_i=an_i-1; end gamma_max=max(fft(acn_i.*acn_i))/Ns
上傳時間: 2020-04-07
上傳用戶:如拷貝般復制
%========================開始提取加噪信號的各類特征值================================ for n=1:1:50; m=n*Ns; x=(n-1)*Ns; for i=x+1:m; %提取加噪信號'signal_with_noise=y+noise'的前256個元素,抽取50次 y0(i)=signal_with_noise(i); end Y=fft(y0); %對調制信號進行快速傅里葉算法(離散) y1=hilbert(y0) ; %調制信號實部的解析式 factor=0; %開始求零中心歸一化瞬時幅度譜密度的最大值gamma_max for i=x+1:m; factor=factor+y0(i); end ms=factor/(m-x); an_i=y0./ms; acn_i=an_i-1; end gamma_max=max(fft(acn_i.*acn_i))/Ns
上傳時間: 2020-04-07
上傳用戶:如拷貝般復制
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
參照棧類模板的例子編寫一個隊列類模板class <T> Queue,私有成員包括:隊首指針Front,隊尾指針Tail,隊列容積max。實現:構造函數Queue,復制構造函數Queue,析構函數~Queue,入隊函數In,出隊函數Out(每次出隊,后面的元素自動前移一位),判隊列空函數Empty。并分別用隊列類模板定義int和double對象,通過實例調用各個成員函數。
標簽: Queue 函數 double class Front Empty 隊列 Tail 模板 Out
上傳時間: 2020-05-04
上傳用戶:1qw2e3r4t5y6u7i8
Digital mobile wireless communication and the Internet have undergone a fantastic growth in the last few years and, despite originating from two different worlds, they are converging. This convergence corresponds to the evolution of mobile systems towards the highest broadband data transmissions (GSM, EDGE/GPRS, UMTS then HSDPA), while the computing world gets equipped with wireless technologies such as Wi-Fi or Wi-Max.
標簽: Reconfigurable Systems Mobile Radio
上傳時間: 2020-06-01
上傳用戶:shancjb
Part I provides a compact survey on classical stochastic geometry models. The basic models defined in this part will be used and extended throughout the whole monograph, and in particular to SINR based models. Note however that these classical stochastic models can be used in a variety of contexts which go far beyond the modeling of wireless networks. Chapter 1 reviews the definition and basic properties of Poisson point processes in Euclidean space. We review key operations on Poisson point processes (thinning, superposition, displacement) as well as key formulas like Campbell’s formula. Chapter 2 is focused on properties of the spatial shot-noise process: its continuity properties, its Laplace transform, its moments etc. Both additive and max shot-noise processes are studied. Chapter 3 bears on coverage processes, and in particular on the Boolean model. Its basic coverage characteristics are reviewed. We also give a brief account of its percolation properties. Chapter 4 studies random tessellations; the main focus is on Poisson–Voronoi tessellations and cells. We also discuss various random objects associated with bivariate point processes such as the set of points of the first point process that fall in a Voronoi cell w.r.t. the second point process.
標簽: Stochastic Geometry Networks Wireless Volume and
上傳時間: 2020-06-01
上傳用戶:shancjb
華為榮耀8手機全系列原廠維修圖紙原理圖電路圖PCB位件圖合集華為榮耀8X Max原廠圖紙華為榮耀8X原廠維修圖紙華為榮耀8原廠維修圖紙華為榮耀8青春原廠維修圖紙
上傳時間: 2021-10-22
上傳用戶:
Wide 2.2V to 6V Input Voltage Range ? 0.20V FB adjustable LED drive current ? Directly drive 9 Series 1W LED at VIN>=6V ? Fixed 800KHz Switching Frequency ? Max. 3A Switching Current Capability ? Up to 92% efficiency ? Excellent line and load regulation ? EN PIN TTL shutdown capability ? Internal Optimize Power MOSFET
標簽: sc3633
上傳時間: 2021-11-05
上傳用戶:d1997wayne