欧美色欧美亚洲高清在线观看,国产特黄特色a级在线视频,国产一区视频一区欧美,亚洲成a 人在线观看中文

  1. <ul id="fwlom"></ul>

    <object id="fwlom"></object>

    <span id="fwlom"></span><dfn id="fwlom"></dfn>

      <object id="fwlom"></object>

      c語言實(shí)驗(yàn)報(bào)告

      時(shí)間:2019-05-12 01:00:26下載本文作者:會(huì)員上傳
      簡介:寫寫幫文庫小編為你整理了多篇相關(guān)的《c語言實(shí)驗(yàn)報(bào)告》,但愿對(duì)你工作學(xué)習(xí)有幫助,當(dāng)然你在寫寫幫文庫還可以找到更多《c語言實(shí)驗(yàn)報(bào)告》。

      第一篇:c語言實(shí)驗(yàn)報(bào)告

      計(jì)算機(jī)軟件技術(shù)基礎(chǔ)實(shí)驗(yàn)報(bào)告

      實(shí)驗(yàn)一:線性表的排序與查找

      一.實(shí)驗(yàn)內(nèi)容

      a)鍵盤輸入一組無序數(shù)據(jù),添加到線性表中; b)排序線性表并輸出排序結(jié)果; c)鍵盤輸入一個(gè)數(shù),并插入到排好序的線性表中(要求插入后的表仍為有序表),輸出結(jié)果;

      d)鍵盤輸入一個(gè)數(shù),并從線性表中刪除相應(yīng)的數(shù)據(jù),輸出結(jié)果。

      二,源程序

      // Experiment1.cpp : 定義控制臺(tái)應(yīng)用程序的入口點(diǎn)。//

      #include “stdafx.h” #include “iostream” #include

      // 程序?qū)崿F(xiàn)有各種方法,這里給出一個(gè)實(shí)例。

      // 定義一個(gè)線性表

      const int nMaxSize = 15;// 最大值 int nLen = 0;

      // 表中元素個(gè)數(shù) int nLinearList[nMaxSize];

      // 定義操作 void LSort();void LOut();void LInsert(int n);void LDelete(int n);

      int main(int argc,TCHAR*argv[]){ // 輸入數(shù)據(jù)并放入線性表中

      printf(“Please input datan”);// std::cout << “Please input datan”;int nIn = 0;for(int i = 1;i <= 10;i++){

      scanf(“%d”,&nIn);// std::cin >> nIn;

      nLinearList[i] = nIn;

      nLen++;

      }

      LSort();// 排序線性表 LOut();// 輸出結(jié)果

      printf(“Please input a data to insert n”);scanf(“%d”,&nIn);LInsert(nIn);// 輸入一個(gè)數(shù)字,并插入到線性表中 LOut();

      printf(“Please input a data to delete n”);scanf(“%d”,&nIn);LDelete(nIn);// 輸入一個(gè)數(shù)字,并從線性表中刪除

      LOut();

      char chTmp;printf(“Please input a char to finish this program.”);chTmp = getch();return 0;}

      void LSort()

      // 冒泡排序,由大到小 { int j,F,k,M;

      F=nLen;while(F>0)

      {k=F-1;F=0;for(j=1;j<=k;j++){if(nLinearList[j]

      M=nLinearList[j];nLinearList[j]=nLinearList[j+1];nLinearList[j+1]=M;F=j;

      }}}

      }

      void LOut(){ printf(“n”);for(int i = 1;i <= nLen;i++){

      printf(“%d, ”, nLinearList[i]);} printf(“n”);} void LInsert(int n){ int i,j;i=1;while(i=i;j--)nLinearList[j+1]=nLinearList[j];nLinearList[i]=n;break;} i++;} } void LDelete(int n){ int i,j;for(i=1;i<=nLen;i++){if(nLinearList[i]==n){for(j=i;j<=(nLen-1);j++)nLinearList[j]=nLinearList[j+1];nLen--;break;}}}

      運(yùn)行結(jié)果

      實(shí)驗(yàn)2:棧與隊(duì)列的應(yīng)用

      一. 實(shí)驗(yàn)內(nèi)容

      a)鍵盤輸入算數(shù)表達(dá)式,并放入隊(duì)列當(dāng)中; b)應(yīng)用棧的概念設(shè)計(jì)表達(dá)式求值算法;

      輸出表達(dá)式求值結(jié)果 二.源程序

      // Experiment2.cpp : 定義控制臺(tái)應(yīng)用程序的入口點(diǎn)。

      #include “stdio.h” #include #include #include

      // 程序?qū)崿F(xiàn)有各種方法,這里給出一個(gè)實(shí)例。

      const int MAX_LEN = 10;// 字符串的長度 const int MAX_SIZE = 30;// ?;蜿?duì)的最大元素個(gè)數(shù)

      // 定義一個(gè)隊(duì)列的結(jié)構(gòu) struct QUEUE { int nMaxSize;// 最大值

      int nCount;// 個(gè)數(shù)

      int nFront;// 頭

      int nRear;// 尾

      char szQueue[MAX_SIZE][MAX_LEN];};

      //定義一個(gè)棧的結(jié)構(gòu) struct STACK { int nMaxSize;// 最大值

      int nTop;// 棧頂

      char szStack[MAX_SIZE][MAX_LEN];};

      // 隊(duì)列的操作

      void InitQueue(QUEUE *q,int nMaxSize){ q->nMaxSize=nMaxSize;q->nCount=0;q->nFront=0;q->nRear=0;q->szQueue[MAX_SIZE][MAX_LEN]=0;} void InQueue(QUEUE *q, char *pItem){ if(q->nCount==q->nMaxSize){

      printf(“The Queue is full!n”);

      return;} strcpy(q->szQueue[q->nRear],pItem);if(q->nRear++==MAX_SIZE)q->nRear=0;q->nCount++;} void OutQueue(QUEUE *q, char *pItem){ if(q->nCount==0){

      printf(“The Queue is empty!n”);

      return;} strcpy(pItem,q->szQueue[q->nFront]);if(q->nFront++==MAX_SIZE)q->nFront=0;q->nCount--;}

      //棧的操作

      void InitStack(STACK *s,int nMaxSize){

      s->nMaxSize=nMaxSize;

      s->nTop=0;

      s->szStack[MAX_SIZE][MAX_LEN]=0;} void PushStack(STACK *s, char *pItem){ char *p;if(s->nTopnMaxSize){

      p=s->szStack[s->nTop];

      strcpy(p,pItem);

      s->nTop++;} else { printf(“The stack overflow!n”);return;} } void PopStack(STACK *s, char *pItem){ char *p;if(s->nTop==0){

      printf(“stack is empty!n”);

      return;} else {

      p=s->szStack[--s->nTop];

      strcpy(pItem,p);} } void GetTopStack(STACK *s, char *pItem){ char *p;char a[10]={0};if(s->nTop==0){

      a[0]=';';

      strcpy(pItem,a);} else {

      p=s->szStack[s->nTop-1];

      strcpy(pItem,p);} }

      //字符判斷 int isdigit(char x){ if(x>='0'&&x<='9')return 1;return 0;}

      int Priority(char *op);// 獲得操作符的優(yōu)先級(jí) void Compute(char *num1, char *num2, char *op, char *chResult);//主函數(shù) void main(){

      // 計(jì)算表達(dá)式的值

      char x[MAX_LEN];

      // 掃描的表達(dá)式

      char op[MAX_LEN];

      // 棧頂運(yùn)算符

      char num1[MAX_LEN], num2[MAX_LEN];

      // 兩個(gè)操作數(shù)

      char chResult[MAX_LEN];

      // 運(yùn)算結(jié)果 // ***聲明一個(gè)隊(duì)列

      struct QUEUE q1;

      struct QUEUE *q;// ***聲明OS棧和NS棧

      struct STACK OS;

      struct STACK NS;

      struct STACK *o;

      struct STACK *n;

      int i=0;

      int j=0;

      int k=0;//****初始化

      q=&q1;

      o=&OS;

      n=&NS;

      InitStack(o,20);

      InitStack(n,20);

      InitQueue(q,20);

      printf(“please input the expression end with //錄入表達(dá)式 do

      {

      printf(”nextn“);

      scanf(”%s“,x);

      InQueue(q,x);}

      while(x[0]!=';');printf(”expression n“);while(true){

      if(q->nCount!=0)

      {

      OutQueue(q, x);

      printf(”%s“,x);

      }

      ”;n“);

      if(isdigit(x[0]))

      PushStack(n,x);

      else

      {

      // 是數(shù)

      // 認(rèn)為是運(yùn)算符,沒有考慮空格等

      GetTopStack(o,op);// 獲得OS棧頂運(yùn)算符 if(x[0] == ';' && op[0] == ';')

      // 掃描結(jié)束 {

      printf(”n result is “);break;} if(Priority(x)> Priority(op)){ PushStack(o,x);continue;}

      // 運(yùn)算符的優(yōu)先級(jí)〉棧頂運(yùn)算符

      while((Priority(x)<= Priority(op))&&Priority(op))

      {

      PopStack(n,num1);

      PopStack(n,num2);

      PopStack(o,op);

      Compute(num2,num1,op,chResult);

      PushStack(n,chResult);

      GetTopStack(o,op);

      }

      PushStack(o,x);

      }

      } PopStack(n,chResult);printf(”%sn“,chResult);}

      int Priority(char *op){ int nPriority = 0;

      switch(op[0]){ case '^':

      nPriority = 3;

      break;case '*': case '/':

      nPriority = 2;

      break;case '+':

      // 不大于棧頂運(yùn)算符

      case '-':

      nPriority = 1;

      break;case ';':

      nPriority = 0;} return nPriority;} void Compute(char *num1, char *num2, char *op, char *chResult){ double fNum1,fNum2;double fResult = 0;fNum1 = atof(num1);fNum2 = atof(num2);switch(op[0]){ case '^':

      fResult = pow(fNum1,fNum2);

      break;case '*':

      fResult = fNum1*fNum2;

      break;case '/':

      fResult = fNum1/fNum2;

      break;case '+':

      fResult = fNum1+fNum2;

      break;case '-':

      fResult = fNum1-fNum2;

      break;}

      } sprintf(chResult,”%.4f",fResult);//把計(jì)算的結(jié)果轉(zhuǎn)化為字符串 return;三.運(yùn)行結(jié)果

      實(shí)驗(yàn)三:關(guān)系數(shù)據(jù)語言的應(yīng)用

      一、實(shí)驗(yàn)內(nèi)容

      查詢學(xué)生出生日期(Sno, Sname, BirthDay);按學(xué)號(hào)順序查詢一個(gè)班級(jí)的所有學(xué)生(Class, Sname);列出學(xué)生選擇各門課程的成績(Sname, Cname, Grade);列出有過不及格成績的學(xué)生名單(Sno, Sname, Class);求學(xué)生的平均成績和總成績(Sname, PJCJ, ZCJ);查找各科成績都 >= 85 分的學(xué)生(Sname, Class);將課程號(hào)為“01”的課程名稱修改為“軟件技術(shù)”;修改一名學(xué)生的姓名、性別、年齡;將成績?yōu)?5~59分的男生的成績修改為60分;刪除90年以后、80年以前出生的學(xué)生的所有信息(包括選課和成績);刪除一個(gè)班級(jí)的所有學(xué)生;刪除所有數(shù)據(jù)表和數(shù)據(jù)庫。

      程序清單及結(jié)果: CREATE TABLE Stu(Sno CHAR(4)PRIMARY KEY, Sname CHAR(10), Sex CHAR(2), Age NUMERIC, BirthDay DATETIME, Class CHAR(10),);CREATE TABLE Course(Cno CHAR(2)PRIMARY KEY, Cname CHAR(10), Chour NUMERIC,);CREATE TABLE Score(Sno CHAR(4), Cno CHAR(2), PRIMARY KEY(Sno,Cno), Grade NUMERIC,)Insert into Stu(Sno,Sname,Sex,Age,BirthDay,Class)values('3626','張小唯','女','18','1995-09-24','電科1202');Insert into Stu(Sno,Sname,Sex,Age,BirthDay,Class)values('3628','王紅','女','19','1994-06-27','電科1202');Insert into Stu(Sno,Sname,Sex,Age,BirthDay,Class)values('3634','李雷','男','20','1992-11-30','電科1202');Insert into Stu(Sno,Sname,Sex,Age,BirthDay,Class)values('3635','張明','男','18','1994-06-03','電科1202');Insert into Stu(Sno,Sname,Sex,Age,BirthDay,Class)values('3641','趙小東','男','20','1993-03-15','電科1202');

      Insert into Course(Cno,Cname,Chour)values('01','asdf','12');Insert into Course(Cno,Cname,Chour)values('02','qwer','23');Insert into Course(Cno,Cname,Chour)values('03','zxcv','34'

      Insert into Score(Sno,Cno,Grade)values('3570','01','97');Insert into Score(Sno,Cno,Grade)values('3580','01','54');Insert into Score(Sno,Cno,Grade)values('3584','01','56');Insert into Score(Sno,Cno,Grade)values('3583','01','88');Insert into Score(Sno,Cno,Grade)values('3574','02','87');Insert into Score(Sno,Cno,Grade)values('3575','03','79');Insert into Score(Sno,Cno,Grade)values('3576','02','68');Insert into Score(Sno,Cno,Grade)values('3577','03','58');Insert into Score(Sno,Cno,Grade)Values('3578','03','98');Insert into Score(Sno,Cno,Grade)values('3626','01','97');Insert into Score(Sno,Cno,Grade)values('3628','01','54');Insert into Score(Sno,Cno,Grade)values('3637','01','56');Insert into Score(Sno,Cno,Grade)values('3640','01','88');Insert into Score(Sno,Cno,Grade)values('3657','02','87');Insert into Score(Sno,Cno,Grade)values('3675','03','79');Insert into Score(Sno,Cno,Grade)values('3676','02','68');Insert into Score(Sno,Cno,Grade)values('3677','03','58');Insert into Score(Sno,Cno,Grade)Values('3678','03','98');

      1.查詢學(xué)生出生日期(Sno, Sname, BirthDay); Select Sno,Sname,BirthDay from Stu;

      2.按學(xué)號(hào)順序查詢一個(gè)班級(jí)的所有學(xué)生(Class, Sname);

      Select Class,Sname from Stu order by Sno;

      3.列出學(xué)生選擇各門課程的成績(Sname, Cname, Grade); Select Sname,Cname,Grade from Stu,Course,Score

      where Stu.Sno=Score.Sno and

      Course.Cno=Score.Cno;

      4.列出有過不及格成績的學(xué)生名單(Sno, Sname, Class);Select distinct Stu.Sno,Sname,Class from Stu,Score where Stu.Sno=Score.Sno and

      Grade<60;

      5.求學(xué)生的平均成績和總成績(Sname, PJCJ, ZCJ);

      Select Sname,avg(Grade)PJCJ,sum(Grade)ZCJ from Stu,Score where Score.Sno=Stu.Sno group by Stu.Sname;

      6.查找各科成績都 >= 85 分的學(xué)生(Sname, Class);

      Select Sname,Class from Stu where exists(Select * from Score where Stu.Sno=Score.Sno and Score.Cno='01' and Score.Grade>=85)and exists(Select * from Score where Stu.Sno=Score.Sno and Score.Cno='02' and Score.Grade>=85)and exists(Select * from Score where Stu.Sno=Score.Sno and Score.Cno='03' and Score.Grade>=85);

      7.將課程號(hào)為“01”的課程名稱修改為“軟件技術(shù)” Update Course set Cname='軟件技術(shù)' where Cno='01';

      8.修改一名學(xué)生的姓名、性別、年齡;

      Update Stu set Sname='aha',Sex='wm',age='10'where Sno='3626';

      9.將成績?yōu)?5~59分的男生的成績修改為60分

      Update Score set Grade=60 where Sno in(Select Sno from Stu where Sex='女')and Grade between 55 and 59;

      10.刪除90年以后、80年以前出生的學(xué)生的所有信息(包括選課和成績)Delete Stu where Sno in(select Sno from Stu where BirthDay < '1980-01-01' or BirthDay>'1990-12-31')

      11.刪除一個(gè)班級(jí)的所有學(xué)生

      Delete from Stu where Class='電科1202';

      12.刪除所有數(shù)據(jù)表和數(shù)據(jù)庫 Drop database MyDB;

      第二篇:《Matlab語言》實(shí)驗(yàn)報(bào)告

      《Matlab語言》實(shí)驗(yàn)(報(bào)告)題庫

      1、TDOA信號(hào)分析類

      (1)已給出一段事先采集的信號(hào),該信號(hào)為進(jìn)行TDOA定位使用的基本信號(hào),其格式為GPS+IQ + GPS+IQ …,即每包數(shù)據(jù)由GPS頭文件和IQ信號(hào)構(gòu)成,GPS頭文件共58B,其數(shù)據(jù)格式為

      $HT,20130114,084556,N3606.82273,E10343.59311,M1538.7,11,0*,每包IQ數(shù)據(jù)共8192B,其數(shù)據(jù)格式為I0,Q0,I1,Q1,I2,Q2…,I2047,Q2047,即I數(shù)據(jù)2048點(diǎn)、Q數(shù)據(jù)2048點(diǎn)交叉出現(xiàn)。換言之,每包數(shù)據(jù)實(shí)際內(nèi)容為:$HT,20130114,084556,N3606.82273,E10343.59311,M1538.7,11,0* I0 Q0 I1 Q1 I2 Q2 … I2047 Q2047,程序前期已實(shí)現(xiàn)讀取IQ數(shù)據(jù)文件并進(jìn)行關(guān)鍵信息讀取分解,請(qǐng)根據(jù)程序提醒,完成相關(guān)功能(數(shù)據(jù)及程序見“1-實(shí)際IQ信號(hào)實(shí)驗(yàn)”文件夾)。

      2、TDOA時(shí)差估計(jì)仿真類

      (2)在TDOA定位技術(shù)中,時(shí)差估計(jì)是一個(gè)非常重要的環(huán)節(jié)。自行仿真2個(gè)具有一定時(shí)差的信號(hào),用廣義互相關(guān)法(GCC)計(jì)算該2個(gè)信號(hào)的時(shí)差,并與設(shè)定時(shí)差進(jìn)行對(duì)比分析(需給出詳細(xì)過程及適當(dāng)?shù)姆抡鎴D)。

      (3)在TDOA定位技術(shù)中,時(shí)差估計(jì)是一個(gè)非常重要的環(huán)節(jié)。自行仿真2個(gè)具有一定時(shí)差的信號(hào),用互模糊函數(shù)法計(jì)算該2個(gè)信號(hào)的時(shí)差,并與設(shè)定時(shí)差進(jìn)行對(duì)比分析(需給出詳細(xì)過程及適當(dāng)?shù)姆抡鎴D)。

      (4)在TDOA定位技術(shù)中,時(shí)差估計(jì)是一個(gè)非常重要的環(huán)節(jié)。自行仿真2個(gè)具有一定時(shí)差的信號(hào),用廣義互相關(guān)(GCC)結(jié)合多項(xiàng)式擬合方法計(jì)算該2個(gè)信號(hào)的時(shí)差,并比較廣義互相關(guān)法估計(jì)時(shí)差和廣義互相關(guān)結(jié)合多項(xiàng)式擬合方法估計(jì)時(shí)差的結(jié)果,進(jìn)行分析(需給出詳細(xì)過程及適當(dāng)?shù)姆抡鎴D)。

      (5)在TDOA定位技術(shù)中,時(shí)差估計(jì)是一個(gè)非常重要的環(huán)節(jié)。自行仿真2個(gè)具有一定時(shí)差的信號(hào),自選方法計(jì)算該2個(gè)信號(hào)的時(shí)差,并與設(shè)定時(shí)差進(jìn)行對(duì)比分析(需給出詳細(xì)過程及適當(dāng)?shù)姆抡鎴D)。

      3、TDOA時(shí)差估計(jì)實(shí)測類

      下面三題使用“3-TDOA實(shí)測類-數(shù)據(jù)”。

      (6)在TDOA定位技術(shù)中,時(shí)差估計(jì)是一個(gè)非常重要的環(huán)節(jié)。根據(jù)提供的TDOA數(shù)據(jù),用廣義互相關(guān)(GCC)計(jì)算該2路信號(hào)的時(shí)差,統(tǒng)計(jì)每包數(shù)據(jù)計(jì)算結(jié)果,并分析之(需給出詳細(xì)解決過程及適當(dāng)?shù)姆治鰣D)。

      (7)在TDOA定位技術(shù)中,時(shí)差估計(jì)是一個(gè)非常重要的環(huán)節(jié)。根據(jù)提供的TDOA數(shù)據(jù),用廣義互相關(guān)(GCC)結(jié)合多項(xiàng)式擬合方法計(jì)算該2路信號(hào)的時(shí)差,比較廣義互相關(guān)法估計(jì)時(shí)差和廣義互相關(guān)結(jié)合多項(xiàng)式擬合方法估計(jì)時(shí)差的結(jié)果,并分析之(需給出詳細(xì)解決過程及適當(dāng)?shù)姆治鰣D)。

      (8)在TDOA定位技術(shù)中,時(shí)差估計(jì)是一個(gè)非常重要的環(huán)節(jié)。根據(jù)提供的TDOA數(shù)據(jù),自選方法計(jì)算該2路信號(hào)的時(shí)差,統(tǒng)計(jì)每包數(shù)據(jù)計(jì)算結(jié)果,并分析之(需給出詳細(xì)解決過程及適當(dāng)?shù)姆治鰣D)。

      4、信號(hào)頻域分析類

      (9)生成一個(gè)帶有噪聲的正弦波信號(hào),信號(hào)的頻率、幅度,噪聲的幅度自行設(shè)定。(將帶有噪聲的正弦信號(hào)放入for循環(huán)中,利于pause,實(shí)現(xiàn)噪聲動(dòng)態(tài)變化效果,并在for循環(huán)內(nèi)畫出其時(shí)域圖和幅頻圖(采樣率和采樣點(diǎn)數(shù)自行設(shè)定),觀察動(dòng)態(tài)變化情況),最后總結(jié)系統(tǒng)采樣率和采樣點(diǎn)數(shù)對(duì)仿真信號(hào)效果的影響。

      (10)自行生成一段時(shí)域信號(hào),要求在不同的時(shí)間,信號(hào)具有不同的頻率(即非平穩(wěn)信號(hào)),用短時(shí)傅里葉變換對(duì)其進(jìn)行時(shí)頻分析,并呈現(xiàn)時(shí)頻分析結(jié)果。

      (11)自行生成一段時(shí)域信號(hào),要求在不同的時(shí)間,信號(hào)具有不同的頻率(即非平穩(wěn)信號(hào)),用小波變換對(duì)其進(jìn)行時(shí)頻分析,并呈現(xiàn)時(shí)頻分析結(jié)果。

      5、信號(hào)調(diào)制解調(diào)類

      (12)自行產(chǎn)生正弦信號(hào)作為基帶信號(hào)、載波,試合成AM信號(hào),在AM信號(hào)上加高斯白噪聲,并將AM信號(hào)解調(diào),畫出各信號(hào)(基帶信號(hào)、載波、合成的AM信號(hào)、解調(diào)后的基帶信號(hào))時(shí)域圖及頻譜圖,并對(duì)比總結(jié)解調(diào)效果。

      (13)自行產(chǎn)生正弦信號(hào)作為基帶信號(hào)、載波,試合成FM信號(hào),在FM信號(hào)上加高斯白噪聲,并將FM信號(hào)解調(diào),畫出各信號(hào)(基帶信號(hào)、載波、合成的FM信號(hào)、解調(diào)后的基帶信號(hào))時(shí)域圖及頻譜圖,并對(duì)比總結(jié)解調(diào)效果。

      (14)自行產(chǎn)生一個(gè)正弦信號(hào),以此為載波,生成一段2ASK信號(hào),其中數(shù)字序列隨機(jī)生成,畫出數(shù)字基帶序列、正弦信號(hào)、2ASK信號(hào)的時(shí)域圖。

      (15)自行產(chǎn)生兩個(gè)不同頻率的正弦信號(hào),以此為載波,生成一段2FSK信號(hào),其中數(shù)字序列隨機(jī)生成,畫出數(shù)字基帶序列、兩個(gè)正弦信號(hào)、2FSK信號(hào)的時(shí)域圖。

      (16)用Matlab模擬通信系統(tǒng)收發(fā)過程,要求:發(fā)射站發(fā)射FM調(diào)制信號(hào),接收站接收該信號(hào),并進(jìn)行解調(diào),系統(tǒng)參數(shù)及傳播環(huán)境/過程參數(shù)自定。

      6、信號(hào)分離類

      (17)自行生成一個(gè)含有3個(gè)頻率(信號(hào)頻率相近,如200Hz,210Hz,300Hz)的信號(hào),其他參數(shù)自定,直接用FFT難以將不同頻率信號(hào),尤其頻率較近的信號(hào)進(jìn)行分離,試用AR等高階功率譜方法,將該信號(hào)進(jìn)行分離,并繪制分離前后的頻譜圖(即信號(hào)的FFT圖、信號(hào)的AR分離圖)。

      (18)自行生成一個(gè)含有不同頻率或不同相位的信號(hào),直接用FFT難以將不同頻率信號(hào),尤其頻率較近或同頻率不同相位的信號(hào)進(jìn)行分離,試用MUSIC方法,將該信號(hào)進(jìn)行分離,并繪制分離前后的頻譜圖(即原信號(hào)的FFT圖、信號(hào)的MUSIC分離圖),并總結(jié)現(xiàn)象。

      (19)自行產(chǎn)生一段含有低頻、高頻和噪聲成分的信號(hào),嘗試設(shè)計(jì)不同的濾波器,將高頻信號(hào)及噪聲濾掉,并繪制濾波前后的信號(hào)對(duì)比圖(含時(shí)域、頻域圖)。

      7、深度學(xué)習(xí)類

      (20)設(shè)計(jì)一個(gè)神經(jīng)網(wǎng)絡(luò)(可以是任意類型的神經(jīng)網(wǎng)絡(luò)),對(duì)手寫數(shù)字進(jìn)行分類,要求小組內(nèi)每個(gè)成員至少每人手寫一個(gè)數(shù)字,然后識(shí)別,并分析識(shí)別準(zhǔn)確率。

      (21)自行找一個(gè)預(yù)訓(xùn)練好的網(wǎng)絡(luò),對(duì)日常生活物品進(jìn)行識(shí)別,要求小組內(nèi)每個(gè)成員拍照1~2個(gè)物品,通過網(wǎng)絡(luò)進(jìn)行識(shí)別,并分析識(shí)別效果。

      第三篇:c語言實(shí)驗(yàn)報(bào)告

      學(xué)號(hào):__________ 姓名:__________ 班級(jí):__________ 日期:__________

      指導(dǎo)教師:__________ 成績:__________

      實(shí)驗(yàn)一 上機(jī)操作初步和簡單的C程序設(shè)計(jì)

      一、實(shí)驗(yàn)?zāi)康?、熟悉C語言運(yùn)行環(huán)境Turbo C++3.02、會(huì)簡單的程序調(diào)試

      3、熟悉C語言各種類型數(shù)據(jù)的輸入輸出函數(shù)的使用方法

      4、掌握順序結(jié)構(gòu)程序設(shè)計(jì)

      二、實(shí)驗(yàn)內(nèi)容

      1、上機(jī)運(yùn)行本章3個(gè)例題,熟悉所用系統(tǒng)的上機(jī)方法與步驟。(習(xí)題1.7)

      2、編寫一個(gè)C程序,輸入a、b、c 3個(gè)值,輸出其中最大者。(習(xí)題1.6)

      3、設(shè)圓半徑r=1.5,圓柱高h(yuǎn)=3,求圓周長、圓面積、圓球表面積、圓球體積、圓柱體積。用scanf輸入數(shù)據(jù),輸出計(jì)算結(jié)果,輸出時(shí)要求有文字說明,取小數(shù)點(diǎn)后2位數(shù)字。注意:在Trubo C++ 3.0中不能輸入漢字,只能輸入英文或拼音。(習(xí)題4.8)

      4、運(yùn)行如下程序,寫出運(yùn)行結(jié)果。第一┆范文網(wǎng)004km.cn整理該文章,版權(quán)歸原作者、原出處所有...#include

      void main()

      {

      int a=1,b=2;

      a=a+b;b=a-b;a=a-b;

      printf(“%d,%dn”,a,b);

      }

      三、實(shí)驗(yàn)步驟與過程

      四、程序調(diào)試記錄

      第四篇:C語言 實(shí)驗(yàn)報(bào)告

      C語言程序設(shè)計(jì)(B)

      (2010-2011-2)

      實(shí)驗(yàn)報(bào)告

      教學(xué)班級(jí): 學(xué)號(hào): 姓名: 課程教師: 實(shí)驗(yàn)輔導(dǎo)教師:

      江西理工大學(xué)

      自由編輯的程序

      一、實(shí)驗(yàn)前的源程序:

      //任意整數(shù)的疊加 #include void main(){ int i,j,sum=0;printf(“please input a int numbern”);scanf(“%d”,&j)for(i=0;i<=j;i++)sum=sum+i;printf(“此數(shù)的疊加=%dn”,sum);}

      實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] D:Program FilesC-Free 4temp未命名10.cpp:7: parse error before

      `for' [Error] D:Program FilesC-Free 4temp未命名10.cpp:7: parse error before `)' 構(gòu)建中止 未命名10: 2 個(gè)錯(cuò)誤, 0 個(gè)警告

      實(shí)驗(yàn)后的源程序:

      //任意整數(shù)的疊加 #include void main(){

      int i,j,sum=0;printf(“please input a int numbern”);scanf(“%d”,&j);for(i=0;i<=j;i++)sum=sum+i;printf(“此數(shù)的疊加=%dn”,sum);}

      二、實(shí)驗(yàn)前的源程序:

      /*小寫字母轉(zhuǎn)大寫字母*/ #include void main(){ char c1,c2;c1='w';

      江西理工大學(xué)

      } c2='s';c1=c1-32;c2=c2-32;printf(“%c,%cn”,c1,c);

      實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] D:Program FilesC-Free 4temp未命名11.cpp:9: `c' undeclared(first

      use this function)[Error] D:Program FilesC-Free 4temp未命名11.cpp:9:(Each undeclared

      identifier is reported only once [Error] D:Program FilesC-Free 4temp未命名11.cpp:9: for each function it

      appears in.)構(gòu)建中止 未命名11: 3 個(gè)錯(cuò)誤, 0 個(gè)警告

      實(shí)驗(yàn)后的源程序:

      /*小寫字母轉(zhuǎn)大寫字母*/ #include void main(){ char c1,c2;c1='w';c2='s';c1=c1-32;c2=c2-32;printf(“%c,%cn”,c1,c2);}

      三、實(shí)驗(yàn)前的源程序:

      /*查看某一年是否為閏年*/ #include void main(){ int year,i;scanf(“%d”,&year);if(year%4==0)

      {

      if(year%100==0)

      {

      if(year%400==0)

      i=1;

      else

      江西理工大學(xué)

      i=0;

      }

      else

      i=1;

      } else

      i=0;if(i)

      printf(“%d 是閏年n”,year);else

      printf(“%d 不是閏年n”,year);}

      實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] D:Program FilesC-Free 4temp未命名14.cpp:15: parse error before

      `else' [Error] D:Program FilesC-Free 4temp未命名14.cpp:25: parse error at end

      of input 構(gòu)建中止 未命名14: 2 個(gè)錯(cuò)誤, 0 個(gè)警告

      實(shí)驗(yàn)后的源程序:

      /*查看某一年是否為閏年*/ #include void main(){ int year,i;scanf(“%d”,&year);if(year%4==0)

      {

      if(year%100==0)

      {

      if(year%400==0)

      i=1;

      else

      i=0;

      }

      else

      i=1;

      } else

      i=0;if(i)

      江西理工大學(xué)

      printf(“%d 是閏年n”,year);else

      printf(“%d 不是閏年n”,year);}

      數(shù)據(jù)的輸入和輸出

      四、程序改錯(cuò)題

      改錯(cuò)前的源程序;#include void main(){ float x,y,z;scanf(“%5.2f,%5.2f”,&x,&y);z=x+y;printf(“z=%5.2f”,&z);} 修改后的源程序:

      #include void main(){ float x,y,z;scanf(“%f%f”,&x,&y);z=x+y;printf(“z=%5.2f”,z);}

      改錯(cuò)前的源程序;#include void main(){ int x=7654123;x*=10;printf(“x=%7d”,x);} 修改后的源程序:

      江西理工大學(xué)

      #include void main(){

      long x=7654123;x*=10;printf(“x=%7d”,x);}

      改錯(cuò)前的源程序:

      #include void main(){ float c1=67;char c2;c2=c1+5;printf(“c1=%c,c2=%cn”,c1,c2);printf(“c1=%d,c2=%d”,&c1,&c2);} 修改后的源程序:

      #include void main(){ int c1=67;char c2;c2=c1+5;printf(“c1=%c,c2=%cn”,c1,c2);printf(“c1=%d,c2=%d”,c1,c2);}

      五、程序編寫題:已知char ch’b’;int i=3 ,j=5;float x=22.354,y=435.6789;根據(jù)下面的輸出結(jié)果編寫程序。ch =’b’,ASCII=98 i=3□□□□□□j=5 x=22.35□□□y=435.68 實(shí)驗(yàn)前的源程序:

      #include void main()

      江西理工大學(xué){ char ch='b';int i=3,j=5;float x=22.354,y=435.6789;printf(“ch='%c',ASCII=%dn”,ch,ch);printf(“i=%d

      j=%dn”,i,j);printf(“x=%.2f

      y=%.2fn”,x,y);} 實(shí)驗(yàn)錯(cuò)誤報(bào)告:無 實(shí)驗(yàn)后的源程序:

      #include void main(){ char ch='b';int i=3,j=5;float x=22.354,y=435.6789;printf(“ch='%c',ASCII=%dn”,ch,ch);printf(“i=%d

      j=%dn”,i,j);printf(“x=%.2f

      y=%.2fn”,x,y);}

      六、從鍵盤輸入一行字符,統(tǒng)計(jì)其中小寫字母、大寫字母和其它字符的個(gè)數(shù):

      實(shí)驗(yàn)前的源程序:

      #include “stdio.h” void main(){ printf(“請(qǐng)任意輸入一串字符:n”);

      char ch,sum1=0,sum2=0,other=0;

      ch=getchar();

      while(c!='n')

      {

      if(c>='A'&&c<='Z')sum1++;

      else if(c>='a'&&c<='z')sum2++;

      else other++;

      c=getchar();

      } printf(“大寫字母的個(gè)數(shù):%dn”,sum1);printf(“小寫字母的個(gè)數(shù):%dn”,sum2);

      江西理工大學(xué)printf(“其他字符母個(gè)數(shù):%dn”,other);}

      實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] D:Program FilesC-Free 4temp未命名7.cpp:7: `c' undeclared(first

      use this function)[Error] D:Program FilesC-Free 4temp未命名7.cpp:7:(Each undeclared

      identifier is reported only once [Error] D:Program FilesC-Free 4temp未命名7.cpp:7: for each function it

      appears in.)構(gòu)建中止 未命名7: 3 個(gè)錯(cuò)誤, 0 個(gè)警告

      實(shí)驗(yàn)后的源程序:

      #include “stdio.h” void main(){ printf(“請(qǐng)任意輸入一串字符:n”);

      char ch,sum1=0,sum2=0,other=0;

      ch=getchar();

      while(ch!='n')

      {

      if(ch>='A'&&ch<='Z')sum1++;

      else if(ch>='a'&&ch<='z')sum2++;

      else other++;

      ch=getchar();

      } printf(“大寫字母的個(gè)數(shù):%dn”,sum1);printf(“小寫字母的個(gè)數(shù):%dn”,sum2);printf(“其他字符母個(gè)數(shù):%dn”,other);}

      七、使用以下公式求∏的近似值,要求精確到最后一項(xiàng)的絕對(duì)值小于10e-4

      ∏/4=1-1/3+1/5-1/7+……

      實(shí)驗(yàn)前的源程序:

      #include “stdio.h” #include “math.h” main(){

      江西理工大學(xué)

      } float sum=0;int i,j;for(i=1;;i++){ j=2*i-1;if(1.0/j>0.0001){ sum+=pow(-1,i+1)*(1.o/j);continue;break;} printf(“∏=%fn”,sum*4.0);

      實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] D:Program FilesC-Free 4temp未命名9.cpp:13: nondigits in number

      and not hexadecimal [Error] D:Program FilesC-Free 4temp未命名9.cpp:19: parse error at end

      of input 構(gòu)建中止 未命名9: 2 個(gè)錯(cuò)誤, 0 個(gè)警告

      實(shí)驗(yàn)后的源程序:

      #include “stdio.h” #include “math.h” main(){ float sum=0;int i,j;for(i=1;;i++){

      j=2*i-1;if(1.0/j>0.0001){ sum+=pow(-1,i+1)*(1.0/j);continue;} break;} printf(“∏=%fn”,sum*4.0);}

      八、用選擇法對(duì)10個(gè)整數(shù)排序: 實(shí)驗(yàn)前的源程序:

      江西理工大學(xué)#include main(){ printf(“請(qǐng)輸入一串亂序的10個(gè)整數(shù):n”);int a[10];int i,j,k;for(i=0;i<10;i++){

      scanf(“%d”,a[i]);} printf(“n”);for(i=0;i<10;i++)for(j=0;j<10-j;j++){

      if(a[j]>a[j+1])

      {

      k=a[j];

      a[j]=a[j+1];

      k=a[j+1];} printf(“這10個(gè)整數(shù)從小到大排列為:”);for(j=0;j<10;j++){

      printf(“%d ”,a[j]);} printf(“n”);printf(“這10個(gè)整數(shù)從大到小排列為:”);for(j=9;j>=0;j--){

      printf(“%d ”,a[j]);}

      實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] D:Program FilesC-Free 4temp未命名1.cpp:33: parse error at end of

      input 構(gòu)建中止 未命名1: 1 個(gè)錯(cuò)誤, 0 個(gè)警告

      實(shí)驗(yàn)后的源程序:

      //用選擇法對(duì)10個(gè)整數(shù)排序

      #include void main(){ printf(“請(qǐng)輸入一串亂序的10個(gè)整數(shù):n”);int a[10];

      江西理工大學(xué) int i,j,k;for(i=0;i<10;i++){ scanf(“%d”,a[i]);} printf(“n”);for(i=0;i<10;i++)for(j=0;j<10-j;j++){ if(a[j]>a[j+1]){

      k=a[j];

      a[j]=a[j+1];

      k=a[j+1];} } printf(“這10個(gè)整數(shù)從小到大排列為:”);for(j=0;j<10;j++){ printf(“%d ”,a[j]);} printf(“n”);printf(“這10個(gè)整數(shù)從大到小排列為:”);for(j=9;j>=0;j--){ printf(“%d ”,a[j]);} }

      九、求一個(gè)3*3的整數(shù)矩陣對(duì)角線元素之積:

      實(shí)驗(yàn)前的源程序:

      #include void main(){ int a[3][3];int i,j,ji=1;printf(“請(qǐng)輸入一個(gè)3*3的矩陣:n”);for(i=0;i<=2;i++)for(j=0;j<=2;j++){

      scanf(“%d”,&a[i][j])} for(i=0;i<3;i++)

      江西理工大學(xué) {

      for(j=0;j<3;j++)

      {

      printf(“%d ”,a[i][j]);

      }

      printf(“n”);

      }

      printf(“n”);

      for(i=0;i<3;i++)

      {

      for(j=0;j<3;j++)

      if(i=j)

      ji*=a[i][j];

      printf(“主對(duì)角線的積為:%dn”,ji);

      } }

      實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] D:Program FilesC-Free 4temp未命名4.cpp:11: parse error before

      `}' 構(gòu)建中止 未命名4: 1 個(gè)錯(cuò)誤, 0 個(gè)警告

      實(shí)驗(yàn)后的源程序:

      #include void main(){ int a[3][3];int i,j,ji=1;printf(“請(qǐng)輸入一個(gè)3*3的矩陣:n”);for(i=0;i<=2;i++)for(j=0;j<=2;j++){

      scanf(“%d”,&a[i][j]);} for(i=0;i<3;i++){

      for(j=0;j<3;j++)

      {

      printf(“%d ”,a[i][j]);

      }

      printf(“n”);

      }

      江西理工大學(xué)

      printf(“n”);

      for(i=0;i<3;i++)

      {

      for(j=0;j<3;j++)

      if(i=j)

      ji*=a[i][j];

      printf(“主對(duì)角線的積為:%dn”,ji);

      } }

      十、將一個(gè)數(shù)組中的值按你需從新存放。例如,原來順序?yàn)?,6,5,4,1。要求改為1,4,5,6,8。

      實(shí)驗(yàn)前的源程序:

      #include void main(){ int a[10],i,j,t;printf(“請(qǐng)問你要輸個(gè)幾個(gè)數(shù)字: ”);scanf(“%d”,&j);printf(“請(qǐng)輸入大小順序的%d個(gè)數(shù)字: ”,j);for(i=0;i

      scanf(“%d”,&a[i]);}

      for(i=0;i

      t=a[i];

      a[i]=a[j-i-1];

      t=a[j-i-1];} printf(“該數(shù)組逆序排列為:”);

      for(i=0;i

      printf(“%d ”,a[i]);printf(“n”);}

      實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] D:Program FilesC-Free 4temp未命名3.cpp:25: parse error at end

      of input 構(gòu)建中止 未命名3: 1 個(gè)錯(cuò)誤, 0 個(gè)警告

      江西理工大學(xué)實(shí)驗(yàn)后的源程序:

      #include void main(){ int a[10],i,j,t;printf(“請(qǐng)問你要輸個(gè)幾個(gè)數(shù)字: ”);scanf(“%d”,&j);printf(“請(qǐng)輸入大小順序的%d個(gè)數(shù)字: ”,j);for(i=0;i

      scanf(“%d”,&a[i]);}

      for(i=0;i

      t=a[i];

      a[i]=a[j-i-1];

      a[j-i-1]=t;} printf(“該數(shù)組逆序排列為:”);

      for(i=0;i

      printf(“%d ”,a[i]);} printf(“n”);}

      江西理工大學(xué)

      第五篇:C語言實(shí)驗(yàn)報(bào)告

      C語言程序設(shè)計(jì)(B)

      (2010-2011-2)

      實(shí)驗(yàn)報(bào)告

      教學(xué)班級(jí):

      學(xué)號(hào):

      姓名:

      課程教師:王華金

      實(shí)驗(yàn)輔導(dǎo)教師:王華金

      江西理工大學(xué)P123--

      五、1、編寫函數(shù),找出5*5數(shù)組對(duì)角線上元素的最小值,并在主函數(shù)中調(diào)用它。要求元素的值通過鍵盤輸入。

      實(shí)驗(yàn)前的源程序:

      #include int func(int p[5][5]){ int i,j,min;min=p[0][0];for(i=0;i<5;i++)

      for(j=0;j<5;j++)

      if(i==j)

      if(p[i][j]

      return min;} void main(){ int i,j,m,a[5][5];printf(“請(qǐng)輸入a[5][5]:n”);for(i=0;i<5;i++)for(j=0;j<5;j++)scanf(“%d”,&a[i][j]);printf(“a[5][5]:n”);for(i=0;i<5;i++){for(j=0;j<5;j++)printf(“%4d”,a[i][j]);printf(“n”);} m=func(a);printf(“主對(duì)角線上元素的最小值為:%dn”,m);} 實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] C:Users陶鑫DocumentsC-FreeTemp未命名4.cpp:13: error: `main' must return `int' [Warning] C:Users陶鑫DocumentsC-FreeTemp未命名4.cpp:27:2: warning: no newline at end of file

      構(gòu)建中止 未命名4: 1 個(gè)錯(cuò)誤, 1 個(gè)警告

      江西理工大學(xué)

      實(shí)驗(yàn)后的源程序:

      #include int func(int p[5][5]){ int i,j,min;min=p[0][0];for(i=0;i<5;i++)

      for(j=0;j<5;j++)

      if(i==j)

      if(p[i][j]

      return min;} main(){ int i,j,m,a[5][5];printf(“請(qǐng)輸入a[5][5]:n”);for(i=0;i<5;i++)for(j=0;j<5;j++)scanf(“%d”,&a[i][j]);printf(“a[5][5]:n”);for(i=0;i<5;i++){for(j=0;j<5;j++)printf(“%4d”,a[i][j]);printf(“n”);} m=func(a);printf(“主對(duì)角線上元素的最小值為:%dn”,m);}

      P123--

      五、3、編寫從整形數(shù)組中檢索給定數(shù)值的函數(shù),若找到則輸出該數(shù)值在數(shù)組中的位置。

      實(shí)驗(yàn)前的源程序:

      #include “stdio.h” int Find(int array[],int Array size,int num){ int i;for(i=0;i

      江西理工大學(xué)int main(){ int a[]={1,2,3,4,5};num=4,n=5,index;index=find(a,5,num);if(index)printf(“%d在數(shù)組中第%d位置”,num,index);else printf(“數(shù)組中沒有這個(gè)數(shù)!”);}

      實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] C:Users陶鑫DocumentsC-FreeTemp未命名3.cpp:2: error: expected `,' or `...' before “size” [Error] C:Users陶鑫DocumentsC-FreeTemp未命名3.cpp:5: error: expected `;' before “size” [Error] C:Users陶鑫DocumentsC-FreeTemp未命名3.cpp:5: error: `size' was not declared in this scope [Error] C:Users陶鑫DocumentsC-FreeTemp未命名3.cpp:5: error: expected `)' before ';' token [Error] C:Users陶鑫DocumentsC-FreeTemp未命名3.cpp:5: error: expected `;' before ')' token [Error] C:Users陶鑫DocumentsC-FreeTemp未命名3.cpp:13: error: `num' was not declared in this scope [Error] C:Users陶鑫DocumentsC-FreeTemp未命名3.cpp:13: error: `n' was not declared in this scope [Error] C:Users陶鑫DocumentsC-FreeTemp未命名3.cpp:13: error: `index' was not declared in this scope

      江西理工大學(xué)[Error] C:Users陶鑫DocumentsC-FreeTemp未命名3.cpp:14: error: `find' was not declared in this scope [Warning] C:Users陶鑫DocumentsC-FreeTemp未命名3.cpp:19:2: warning: no newline at end of file 實(shí)驗(yàn)后的源程序:

      #include “stdio.h” int Find(int Array[], int Array_size, int num){ int i;for(i=0;i

      P123--

      五、6、輸入10名學(xué)生5門課的成績,分別用函數(shù)求:(1)每門課的平均分。(2)找出最高的分?jǐn)?shù)所對(duì)應(yīng)的學(xué)生和成績。

      實(shí)驗(yàn)前的源程序:

      #include void input(float a[10][5])//輸入學(xué)生成績 { int i,j;

      for(i=0;i<10;i++)

      {

      printf(“輸入第%d個(gè)學(xué)生五門課的成績:”,i+1);

      for(j=0;j<5;j++)

      scanf(“%f”,&a[i][j]);

      } } void aver_cour(float a[10][5])//課程的平均分

      江西理工大學(xué) {

      int i,j;

      float sum;

      for(i=0;i<5;i++)

      {

      sum=0;

      for(j=0;j<10;j++)

      sum+=a[j][i];

      printf(“第%d門課的平均成績?yōu)椋?6.2fn”,i+1,sum/10);

      } } void highest(float a[10][5])//查找最高分

      {

      int i,j,flag1,flag2;float max=0;

      for(i=0;i<10;i++)

      {

      for(j=0;j<5;j++)

      {

      if(max

      {

      max=a[i][j];

      flag1=i;

      flag2=j;

      }

      }

      }

      printf(“最高分對(duì)應(yīng)的是學(xué)生:%d課程:%dn”,flag1+1,flag2+1);} void main(){

      float a[10][5];

      input(a);

      aver cour(a);

      highest(a);

      }

      實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] C:Users陶鑫DocumentsC-FreeTemp未命名6.cpp:35: error: `main' must return `int' [Error] C:Users陶鑫DocumentsC-FreeTemp未命名6.cpp:38: error: `aver' was not declared in this scope [Error] C:Users陶鑫DocumentsC-FreeTemp未命名6.cpp:38: error: expected `;' before “cour”

      江西理工大學(xué)[Warning] C:Users陶鑫DocumentsC-FreeTemp未命名6.cpp:40:4: warning: no newline at end of file

      構(gòu)建中止 未命名6: 3 個(gè)錯(cuò)誤, 1 個(gè)警告 實(shí)驗(yàn)后的源程序:

      #include void input(float a[10][5])//輸入學(xué)生成績 { int i,j;

      for(i=0;i<10;i++)

      {

      printf(“輸入第%d個(gè)學(xué)生五門課的成績:”,i+1);

      for(j=0;j<5;j++)

      scanf(“%f”,&a[i][j]);

      } } void aver_cour(float a[10][5])//課程的平均分

      {

      int i,j;

      float sum;

      for(i=0;i<5;i++)

      {

      sum=0;

      for(j=0;j<10;j++)

      sum+=a[j][i];

      printf(“第%d門課的平均成績?yōu)椋?6.2fn”,i+1,sum/10);

      } } void highest(float a[10][5])//查找最高分

      {

      int i,j,flag1,flag2;float max=0;

      for(i=0;i<10;i++)

      {

      for(j=0;j<5;j++)

      {

      if(max

      {

      max=a[i][j];

      flag1=i;

      flag2=j;

      }

      }

      }

      printf(“最高分對(duì)應(yīng)的是學(xué)生:%d課程:%dn”,flag1+1,flag2+1);} main()

      江西理工大學(xué)

      {

      float a[10][5];

      input(a);

      aver_cour(a);

      highest(a);} P173-

      五、2、對(duì)具有10個(gè)元素的char類型的數(shù)組,從下標(biāo)為6的元素開始全部設(shè)置'#'號(hào),保持前6個(gè)元素中的內(nèi)容不變。

      實(shí)驗(yàn)前的源程序:

      #include“stdio.h” main(){int i;char a[10]={'h','e','l','l','o','j','p','i','j','d'};for(i=0;i<10;i++)printf(“%c”,a[i]);printf(“n”);

      for(pi=(a+6);pi<(a+10);pi++)

      *pi='#';for(i=0;i<10;i++)printf(“%c”,a[i]);} 實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] C:Users陶鑫DocumentsC-FreeTemp未命名1.cpp:8: `pi' undeclared(first use this function)[Error] C:Users陶鑫DocumentsC-FreeTemp未命名1.cpp:8:(Each undeclared identifier is reported only once [Error] C:Users陶鑫DocumentsC-FreeTemp未命名1.cpp:8: for each function it appears in.)

      構(gòu)建中止 未命名1: 3 個(gè)錯(cuò)誤, 0 個(gè)警告

      江西理工大學(xué)

      實(shí)驗(yàn)后的源程序:

      #include“stdio.h” main(){int i;char a[10]={'h','e','l','l','o','j','p','i','j','d'}, *pi;for(i=0;i<10;i++)printf(“%c”,a[i]);printf(“n”);

      for(pi=(a+6);pi<(a+10);pi++)

      *pi='#';for(i=0;i<10;i++)printf(“%c”,a[i]);}

      P173-

      五、5、輸入10個(gè)整數(shù),將其中最小的數(shù)與第一個(gè)數(shù)對(duì)換,把最大的數(shù)與最后一個(gè)數(shù)對(duì)換,并輸出對(duì)換后的10個(gè)數(shù)。

      實(shí)驗(yàn)前的源程序:

      #include void Deal(int *p){ int i,m;

      int max,min;

      max=min=0;for(i=0;i<10;i++){

      if(*(p+i)>*(p+max))max=i;

      if(*(p+i)<*(p+min))min=i;} m=p[0];p[0]=p[max];p[max]=m;m=p[9];p[9]=p[min];p[min]=m;} void Show(int *p){ int i=0;printf(“交換后結(jié)果如下:n”);while(i<10)

      printf(“%d ”,*(p+i++));printf(“n”);}

      江西理工大學(xué)void main(){ int data[10];int i=0;printf(“請(qǐng)輸入十個(gè)數(shù):n”);while(i<10)

      scanf(“%d”,data+i++)Deal(data);Show(data);} 實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      [Error] C:Users陶鑫DocumentsC-FreeTemp未命名7.cpp:24: error: `main' must return `int' [Error] C:Users陶鑫DocumentsC-FreeTemp未命名7.cpp:30: error: expected `;' before “Deal” [Warning] C:Users陶鑫DocumentsC-FreeTemp未命名7.cpp:32:2: warning: no newline at end of file

      構(gòu)建中止 未命名7: 2 個(gè)錯(cuò)誤, 1 個(gè)警告

      實(shí)驗(yàn)后的源程序:

      #include void Deal(int*p){ int i,m;int max,min;max=min=0;for(i=0;i<10;i++){ if(*(p+i)>*(p+max))max=i;if(*(p+i)<*(p+min))min=i;} m=p[0];p[0]=p[min];p[min]=m;m=p[9];p[9]=p[max];p[max]=m;

      江西理工大學(xué)} void Show(int*p){ int i=0;printf(“交換后結(jié)果如下:n”);while(i<10)printf(“%d”,*(p+i++));printf(“n”);} void main(){ int data[10];int i=0;printf(“請(qǐng)輸入十個(gè)數(shù):n”);while(i<10)scanf(“%d”,data+i++);Deal(data);Show(data);}

      P173-

      五、7、編寫小學(xué)生做加、減、乘、除四則運(yùn)算的程序。例如在操作系統(tǒng)下,鍵入cal 15*15< 回車>,則在屏幕上顯示15*15=225.實(shí)驗(yàn)前的源程序:

      實(shí)驗(yàn)錯(cuò)誤報(bào)告:

      實(shí)驗(yàn)后的源程序:

      #include main(){

      int i,j,k;char *f[2];int b[2];scanf(“%s”,&f[1]);scanf(“%d”,&b[1]);

      江西理工大學(xué)

      江西理工大學(xué)12

      } scanf(“%s”,&f[2]);scanf(“%d”,&b[2]);i=b[1];j=b[2];k=i*j;printf(“%d*%d=%d”,i,j,k);

      下載c語言實(shí)驗(yàn)報(bào)告word格式文檔
      下載c語言實(shí)驗(yàn)報(bào)告.doc
      將本文檔下載到自己電腦,方便修改和收藏,請(qǐng)勿使用迅雷等下載。
      點(diǎn)此處下載文檔

      文檔為doc格式


      聲明:本文內(nèi)容由互聯(lián)網(wǎng)用戶自發(fā)貢獻(xiàn)自行上傳,本網(wǎng)站不擁有所有權(quán),未作人工編輯處理,也不承擔(dān)相關(guān)法律責(zé)任。如果您發(fā)現(xiàn)有涉嫌版權(quán)的內(nèi)容,歡迎發(fā)送郵件至:645879355@qq.com 進(jìn)行舉報(bào),并提供相關(guān)證據(jù),工作人員會(huì)在5個(gè)工作日內(nèi)聯(lián)系你,一經(jīng)查實(shí),本站將立刻刪除涉嫌侵權(quán)內(nèi)容。

      相關(guān)范文推薦

        c語言實(shí)驗(yàn)報(bào)告

        實(shí)驗(yàn)一 熟悉C語言程序的運(yùn)行環(huán)境 一、實(shí)驗(yàn)?zāi)康?1、了解在該系統(tǒng)上如何編輯、編譯、連接和運(yùn)行一個(gè)C 程序; 2、通過運(yùn)行簡單的C程序,初步了解C程序的特點(diǎn)。 二、實(shí)驗(yàn)預(yù)習(xí)1、......

        c語言實(shí)驗(yàn)報(bào)告

        南昌大學(xué)實(shí)驗(yàn)報(bào)告 學(xué)生姓名: 學(xué) 號(hào): 專業(yè)班級(jí): √ 綜合 □ 設(shè)計(jì) □ 創(chuàng)新 實(shí)驗(yàn)日期: 實(shí)驗(yàn)成績: 實(shí)驗(yàn)類型:□ 驗(yàn)證 □一.實(shí)驗(yàn)名稱 實(shí)驗(yàn)3 控制語句 二.實(shí)驗(yàn)?zāi)康?1.熟練掌握if 、if…el......

        C語言實(shí)驗(yàn)報(bào)告

        鄭州輕工業(yè)學(xué)院 實(shí) 踐 報(bào) 告 實(shí)現(xiàn)內(nèi)容: OJ1123最佳校友(數(shù)組)、OJ1158又是升序(指針)、OJ1180成績統(tǒng)計(jì)(結(jié)構(gòu))、OJ1203做幻方(文件) 學(xué)號(hào):541507020140 學(xué)生姓名:王紅旭 專業(yè)班級(jí):電子信......

        C語言實(shí)驗(yàn)報(bào)告

        實(shí)驗(yàn)一 C程序的運(yùn)行環(huán)境和方法 一、實(shí)驗(yàn)?zāi)康?1.了解所用的計(jì)算機(jī)系統(tǒng)。 2.了解在該系統(tǒng)上如何進(jìn)行編輯、編譯、連接和運(yùn)行一個(gè)C程序。 3.通過運(yùn)行簡單的C程序了解C程序的特點(diǎn)。 二......

        C語言實(shí)驗(yàn)報(bào)告

        C語言程序設(shè)計(jì)(B) (2010-2011-2) 實(shí)驗(yàn)報(bào)告2 教學(xué)班級(jí): 學(xué)號(hào): 姓名:課程教師: 實(shí)驗(yàn)輔導(dǎo)教師: 一、做一個(gè)“楊輝三角” 實(shí)驗(yàn)前的源程序: /*楊輝三角*/ #include void fun(int Y[][]......

        C語言實(shí)驗(yàn)報(bào)告

        C語言程序設(shè)計(jì)實(shí)驗(yàn) --------指針應(yīng)用實(shí)驗(yàn) ========================山東農(nóng)業(yè)大學(xué)實(shí)驗(yàn)報(bào)告 課程名稱: c語言程序設(shè)計(jì)實(shí)驗(yàn) 學(xué)院: 水利土木工程學(xué)院 專業(yè): 道路橋梁與渡河工程......

        C語言實(shí)驗(yàn)報(bào)告

        C語言第一學(xué)期實(shí)驗(yàn): 第1次實(shí)驗(yàn): 時(shí)間 2010-9-15 項(xiàng)目名稱:創(chuàng)建第一個(gè)C語言程序 儀器設(shè)備:電腦一臺(tái),操作系統(tǒng)WindowsXP,開發(fā)環(huán)境Visual C++ 6.0 實(shí)驗(yàn)程序: 1、 單擊“開始”“程序”......

        C語言實(shí)驗(yàn)報(bào)告

        《C語言程序設(shè)計(jì)》實(shí)驗(yàn)報(bào)告實(shí)驗(yàn)名稱 ____ C程序的運(yùn)行環(huán)境和運(yùn)行C程序的方法_學(xué)期日期 同組人李江濤指導(dǎo)老師_楊雪松___________成績___________ -------------------------......