第一篇:期末C語言課程總結報告
《期末C語言課程總結報告》
報告人情況:
班級:自控1102姓名:趙鐸學號:2011010807理論課老師姓名:李文杰實驗課老師姓名:張紅霞
學習到了以下內(nèi)容:1、2、3、4、5、6、7、8、9、掌握C語言中,基本的輸入輸出函數(shù)的使用方法。掌握printf中轉(zhuǎn)義字符’t’,’n’的用法。掌握賦值語句的用法。掌握算術表達式、賦值表達式的計算。掌握數(shù)學函數(shù)的使用。掌握關系運算及其表達式。掌握邏輯運算及其表達式。掌握條件運算符。掌握if語句。
10、掌握switch語句。
11、掌握for,while語句的使用方法。
12、掌握直到型循環(huán)do-while的用法。
13、掌握break,continue的用法。
14、掌握函數(shù)的分類。
15、掌握自定義函數(shù)的方法。
16、掌握自定義函數(shù)的調(diào)用用法。
17、掌握函數(shù)參數(shù)的傳遞。
18、掌握全局變量,局部變量,靜態(tài)變量的使用。
19、掌握數(shù)組的定義。
20、掌握數(shù)組的引用,使用方法。
21、掌握字符串的儲存與操作。
22、掌握字符串作為特殊的一維數(shù)組。
23、更加嫻熟使用數(shù)組解決問題。
24、掌握二維數(shù)組的使用方法。
25、更加熟悉字符串解決問題的方法。
26、增強了數(shù)組中排列順序的邏輯關系。
27、掌握指針的概念。
28、掌握指針定義,賦值,引用的方法。
29、掌握指針訪問一維數(shù)組的方法。
30、掌握指針作為參數(shù)的使用。
31、掌握指向數(shù)組的指針作為函數(shù)參數(shù)。
掌握了以下:
1、掌握C語言中,基本的輸入輸出函數(shù)的使用方法。
2、掌握printf中轉(zhuǎn)義字符’t’,’n’的用法。
3、掌握賦值語句的用法。
4、掌握算術表達式、賦值表達式的計算。
5、掌握數(shù)學函數(shù)的使用。
6、掌握關系運算及其表達式。
7、掌握邏輯運算及其表達式。
8、掌握條件運算符。
9、掌握if語句。
10、掌握switch語句。
11、掌握for,while語句的使用方法。
12、掌握直到型循環(huán)do-while的用法。
13、掌握指針的概念。
14、掌握指針定義,賦值,引用的方法。
15、掌握指針訪問一維數(shù)組的方法。
自己的經(jīng)驗
學習C語言絕不是聽懂就可以的,而是必須自己動手去實踐,從自己的實踐中找到不足和缺點,及時發(fā)現(xiàn)和改正能使自己記得更加牢固,使以后編寫程序更加流暢和嚴謹!
對老師的意見
老師講課很清晰,很容易懂,讓我更好地理解了C語言這門課程,幫助我在今后的工作學習中打好了基礎,也更好地理解了計算機的程序的來源,能自己設計出自己想的程序,能使自己以后更好地生活!
第二篇:期末C語言課程總結報告
《期末C語言課程總結報告》
報告人情況:
班級: 姓名: 學號:
理論課老師姓名: 實驗課老師姓名:
以下寫的內(nèi)容要求如下:通過程序設計課的學習,本人所學到的有關程序設計的知識回顧,學習了哪些算法,認為已經(jīng)掌握的算法(不需要看書就能編)和完全沒掌握的算法;在學習程序設計語言的過程中自己的經(jīng)驗和教訓;對老師講課和指導過程中教學態(tài)度和教學方法的看法和意見(要實事求是,意見決不會作為分數(shù)高低的依據(jù),分別對理論課老師和實驗課老師評價),對老師在今后教學的建議;對下一屆同學學習本課程的建議等等。此報告在平時成績考核時作為主要參考。
C語言課成績評定辦法:實驗(實驗報告20%+實驗表現(xiàn)5%)25%+(平時作業(yè)及表現(xiàn)10%+總結報告5%)15%+期末考試60%
第三篇:C語言期末總結
結構體
例10.4 指向結構體數(shù)組的指針的應用
#include
printf(″No.Name
sex
agen″);
for(p=stu;p<stu+3;p++)
printf(″%5d %-20s %2c %4dn″,p->num,p->name,p->sex,p->age);
} 運行結果:
No.Name
sex
age
10101
LiLin
M
1010Zhang Fun M
10104
WangMing F
例10.5 有一個結構體變量stu,內(nèi)含學生學號、姓名和3門課程的成績。要求在main函數(shù)中賦予值,在另一函數(shù)print中將它們輸出。今用結構體變量作函數(shù)參數(shù)。#include
char name[20];
float score[3];};
#include
char name[20];
float score[3];};
void main(){ void print(struct student);
struct student stu;
stu.num=12345;
strcpy(stu.name,″LiLin″);
stu.score[0]=67.5;
stu.score[1]=89;
stu.score[2]=78.6;
print(stu);} void print(struct student stu){ printf(FORMAT,stu.num,stu.name,stu.score[0],stu.score[1],stu.score[2]);
printf(″n″);} 運行結果: 12345 Li Li 67.500000 89.000000 78.599998 例10.6 將上題改用指向結構體變量的指針作參數(shù)。#include
char name[20];
float score[3];}stu={12345, ″LiLi″,67.5,89,78.6};void main(){ void print(struct student *);
print(&stu);}
void print(struct student *p){ printf(FORMAT,p->num,p->name,p->score[0],p->score[1],p->score[2]);
printf(″\n″); } 運行結果: 12345 Li Li 67.500000 89.000000 78.599998 ? 有10個學生,每個學生的數(shù)據(jù)包括學號、姓名、3門課的成績,從鍵盤輸入10個學生數(shù)據(jù),要求輸出3門課程總平均成績,以及最高分的學生的數(shù)據(jù)(包括學號、姓名、3門課程總成績、平均分數(shù))。? 10.1:# include
struct student ?
{ char num[6];?
char name[8];?
int score[3];?
float avr;?
}stu[10];
? main()?
{ int i,j,max=0,maxi=0,sum=0;?
float average=0;?
for(i=0;i<10;i++)?
{ scanf(“%s%s”,stu[i].num,stu[i].name);?
for(j=0;j<3;j++)?
scanf(“%d”,&stu[i].score[j]);?
}
? for(i=0;i<10;i++)?
{ sum=0;?
for(j=0;j<3;j++)?
sum+=stu[i].score[j];?
stu[i].avr=sum/3.0;?
average+=stu[i].avr;?
if(sum>max){ max=sum;maxi=i;} ?
} ?
average/=10;?
printf(“average=%6.2fn”,average);
printf(“The highest is:%s,%s,%d,%f”,stu[maxi].num,stu[maxi].name,max,stu[maxi].avr);? }
指針
例9.4 輸入a、b、c3個整數(shù),按大小順序輸出。#include
{void exchange(int *q1,int *q2,int *q3);int a,b,c,*p1,*p2,*p3;
scanf(″%d,%d,%d″,&a, &b, &c);
p1=&a;p2=&b;p3=&c;
exchange(p1,p2,p3);
printf(″%d,%d,%d\n″,a,b,c);
}
void exchange(int *q1,int *q2,int *q3){ void swap(int *pt1,int *pt2);
if(*q1<*q2)swap(q1,q2);
if(*q1<*q3)swap(q1,q3);
if(*q2<*q3)swap(q2,q3);
}
void swap(int *pt1,int *pt2)
{int temp;
temp=*pt1;
*pt1=*pt2;
*pt2=temp;
score 3
}
運行情況如下:
9,0,10↙ 10,9,0
例9.10:有一個班,3個學生,各學4門課,計算總平均分數(shù)以及第n個學生的成績。這個題目是很簡單的。只是為了說明用指向數(shù)組的指針作函數(shù)參數(shù)而舉的例子。用函數(shù)average求總平均成績,用函數(shù)search找出并輸出第i個學生的成績。#include
{ void average(float *p,int n);
void search(float(*p)[4],int n);
float score[3][4]={{65,67,70,60},average(*score,12); /*求12個分數(shù)的平均分*/
search(score,2);
/*求序號為2的學生的成績*/ }
void average(float *p,int n){ float*p_end;
float sum=0,aver;
p_end=p+n-1;
for(;p<=p_end;p++)
sum=sum+(*p);
aver=sum/n;
printf(″average=%5.2f\n″,aver); }
void search(float(*p)[4],int n)
/ * p是指向具有4個元素的一維數(shù)組的指針 */ {int i;
printf(″the score of No.%d are:n″,n);
for(i=0;i<4;i++)
printf(″%5.2f″,*(*(p+n)+i));}
程序運行結果如下: average=82.25
The score of No.2 are:
90.00 99.00 100.00 98.00
例9.11: 在上題基礎上,查找有一門以上課程不及格的學生,打印出他們的全部課程的成績。
#include
{void search(float(*p)[4],int n);
float score[3][4]={{65,57,70,60},{58,87,90,81},{90,99,100,98}};
{80,87,90,81},{90,99,100,98}};
search(score,3);
}
void search(float(*p)[4],int n){int i,j,flag;
for(j=0;j<n;j++)
{flag=0;
for(i=0;i<4;i++)
if(*(*(p+j)+i)<60)flag=1;
if(flag==1)
{ printf(“No.%d fails,his scores are: \n”,j+1);
for(i=0;i<4;i++)
printf(″%5.1f″,*(*(p+j)+i));
printf(″\n″);
}
}
}
程序運行結果如下:
No.1 fails, his scores are:
65.0
57.0
70.0
60.0 No.2 fails, his scores are:
58.0 87.0 90.0 81.0 例9.17:求a和b中的最大者。#include
{int max(int,int);int a,b,c;
scanf(″%d,%d″,&a,&b);
c=max(a,b);printf(″a=%d,b=%d,max=%dn″,a,b,c);
}
int max(int x,int y){ int z;
if(x>y)z=x;
else
z=y;
return(z);
}
例9.18:有若干個學生的成績(每個學生有4門課程),要求在用戶輸入學生序號以后,能輸出該學生的全部成績。用指針函數(shù)來實現(xiàn)。
#include
{float score[][4]={{60,70,80,90},{56,89,67,88},{34,78,90,66}};
float *search(float(*pointer)[4],int n);
float*p;
int i,m;
printf(″enter the number of student:″);
scanf(″%d″,&m);
printf(″The scores of No.%d are:n″,m); p=search(score,m);
for(i=0;i<4;i++)printf(″%5.2ft″,*(p+i));
}
float *search(float(*pointer)[4],int n){ float *pt;
pt=*(pointer+n);
return(pt);
}
運行情況如下:
enter the number of student:1↙ The scores of No.1 are:
56.00
89.00
67.00
88.00 例9.19: 對上例中的學生,找出其中有不及格課程的學生及其學生號。#include
{ float score[][4]={{60,70,80,90},{56,89,67,88},{34,78,90,66}};
float search(float(*pointer)[4]);
float*p;
int i,j;
for(i=0;i<3;i++)
{p=search(score+i);
if(p==*(score+i))
{ printf(″No.%d scores:″,i);
for(j=0;j<4;j++)
printf(″%5.2f″,*(p+j));
printf(″n″);}
}
}
float *search(float(*pointer)[4]){ int i;
float *pt;
pt=*(pointer+1);
for(i=0;i<4;i++)
if(*(*pointer+i)<60)pt=*pointer;
return(pt);
} 運行情況如下:
No.1 scores:56.00 89.00 67.00 88.00
No.2 scores:34.00 78.00 90.00 66.00
例9.20:將若干字符串按字母順序(由小到大)輸出。#include
{void sort(char *name[ ],int n);
void print(char *name[ ],int n);
char *name[ ]={“Follow me”,“BASIC”,“Great Wall″,”FORTRAN“,”Computer design“};int n=5;
sort(name,n);
print(name,n);
}
void sort(char *name[ ],int n){char *temp;
int i,j,k;
for(i=0;i<n-1;i++){k=i;
for(j=i+1;j<n;j++)
if(strcmp(name[k],name[j])>0)k=j;
if(k!=i)
{ temp=name[i];
name[i]=name[k];
name[k]=temp;}
}
}
void print(char *name[ ],int n){ int i;
for(i=0;i<n;i++)
printf(″%sn″,name[i]);
} 運行結果為: BASIC Computer design FORTRAN Follow me Great Wall 作業(yè):(提交上機報告)輸入10個整數(shù),將其中最小的數(shù)與第一個數(shù)對換,把最大的數(shù)與最后一個數(shù)對換。寫3個函數(shù):①輸入10個數(shù);②進行處理;③輸出10個數(shù)。# include
{ void input(int number[10]);
void max_min_value(int array[10]);
void output(int array[10]);
int number[10];input(number);max_min_value(number);output(number);
} void input(int number[10])
{ int i;
for(i=0;i<=9;i++)
scanf(“%d”,&number[i]);} void max_min_value(int array[10])
{ int *max,*min,*p,*array_end;
array_end=array+10;
max=min=array;
for(p=array+1;p if(*p>*max)max=p; else if(*p<*min)min=p; *p=array[0];array[0]=*min;*min=*p; *p=array[9];array[9]=*max;*max=*p; } void output(int array[10]) { int *p; for(p=array;p<=array+9;p++) printf(“%4d”,*p); } 數(shù)組和函數(shù)的組合 例8.12 有一個一維數(shù)組,內(nèi)放10個學生成績,寫一個函數(shù),求出平均分、最高分和最低分。#include /*全局變量*/ void main() {float average(float array[ ],int n); float ave,score[10]; int i; for(i=0;i<10;i++) scanf(″%f″,&score[i]); ave= average(score,10); printf(″max=%6.2f\nmin=%6.2f\n average=%6.2f\n″,Max,Min,ave); } float average(float array[ ],int n) /*定義函數(shù),形參為數(shù)組*/ { int i; float aver,sum=array[0]; Max=Min=array[0]; for(i=1;i<n;i++) {if(array[i]>Max)Max=array[i]; else if(array[i] sum=sum+array[i]; } aver=sum/n; return(aver); } 例8.18 有一個含若干字符的字符串,今輸入一個字符,要求程序?qū)⒆址性撟址麆h去。用外部函數(shù)實現(xiàn)。file1.c(文件1)#include { extern void enter_string(char str[]); extern void detele_string(char str[],char ch); extern void print_string(char str[]); char c; char str[80];enter_string(str); scanf(”%c“,&c); detele_string(str,c); print_string(str); } file2.c(文件2)#include gets(str);} file3.c(文件3) void delete_string(char str[],char ch){ int i,j; for(i=j=0;str[i]!='