C语言外语



《C语言外语》由会员分享,可在线阅读,更多相关《C语言外语(34页珍藏版)》请在装配图网上搜索。
1、,单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,2020/2/23,西安邮电大学,#,Lab Programming Syllabus,High-level Language Programming I,Chunhua Pan,Lab Schedule and Policy,Every Wednesday or by appointment;,Totally 24 hours,2 hours per week;,Please be sure to get in the lab on time;,Assignment will be shown in the
2、 class on the morning of the same day;,Some assignments will be graded;,It is a good habit to write the program on paper prior the lab time;,Please write your program carefully and independently.,2,Programming Environment,3,Assignment#1,Write a program to show the following sentences:,I am a student
3、.,I love China.,4,Assignment#1,Write a program to show the following figure:,5,Assignment#1,Given the values of three variables,a=2,b=4,c=7,write a program to,calculate the sum of a,b and c;,compute and output the value of variable,x,where,x=a/(b c),The result should be like the figure shown below:,
4、6,Assignment#2,Write a program to get the values of integer a and b from the keyboard,and then calculate the results of,a+b,a b,a*b,a/b,and,a%b,respectively.,7,Assignment#2,Input the bottom length and height of a triangle,output the area of this triangle(Reserve two effective digits).,8,Assignment#2
5、,Input five integers from the keyboard,and then output the minimum number among them.,9,Assignment#3,Input n from keyboard,and calculate n!,10,Assignment#3,Print the first 20 Fibonacci Numbers.,11,Assignment#3,Print all the,“Daffodils Number”,between 100 999.,12,Assignment#3,Input several numbers fr
6、om keyboard,print the max number among them.,13,Assignment#4,Write a function to return the maximum number in five numbers,you can use the function,getMax(int a,int b,int c),two times.,14,Assignment#4,Write a program to accept two numbers from the keyboard,and then print the greatest common divisor(
7、,最大公约数,)and the least common multiple(,最小公倍数,)using functions.,15,Assignment#4,Calculate 1+2+n using,nested,calls of functions.,16,Assignment#4,Calculate 1+2+n using,recursive,calls of functions.,17,Assignment#5,Input several numbers,and output its reverse.,18,Assignment#5,Input a string,output the
8、number of words it contains.,19,Assignment#5,Write a program to accept a string and a character,and then delete each element which is equal to the character from the array.,20,Assignment#5,Write a program to implement the following questions:,Define a function,void input(int s,int n),to get ten inte
9、gers into an array;,Define a function,void sort(int s,int n),to sort these integers in the array;,Define a function,void print(int s,int n),to output the sorted numbers in the array;,Finally,write appropriate,main,function to test your program.,21,Assignment#6,Use the,arrays of structures,to store f
10、ive students information including,id,name,and,score,input the information from the keyboard,output the information of the student with the,maximum score,then,sort,these students by scores from low to high,finally,output information of these students.,22,23,Assignment#6,Write a function,void,decreme
11、nt(,int,*,a)to decrease the value of the argument in the main function by 1.You should use pointer as parameter to the function,decrement,24,Assignment#7,Write a function,void,decrement(,int,*,a)to decrease the value of the argument in the main function by 1.You should use pointer as parameter to th
12、e function,decrement.,Similarly,write a function,swap,to exchange the values of two variables outside the function,25,Assignment#7,Input,n,from the keyboard,Input,n,numbers from the keyboard and store them to a,dynamically allocated array,Sort,these numbers using any of the sorting algorithms,Output
13、 the sorted numbers to the,screen,Finally,output these sorted numbers to,a file,named“output.txt”,26,Assignment#8,Input,n,from the keyboard,Input,n,students data from the keyboard and store them to a,dynamically allocated array of structures,Output the student that has the,maximum grade,to the scree
14、n,Sort,these students data by score from low to high,Finally,output these data to,a file,named“output.txt”,27,Assignment#9,Write a program to implement the following questions.,Input the size for the first array;,Input the size for the second array;,Input the numbers for the first and the second arr
15、ay;,Output he numbers which the first array has but the second array does not have;,Output the numbers which the second array has but the first array does not have;,Output the common elements of the two arrays;,28,Assignment#9,29,Assignment#10,Write a program to implement the address book using dyna
16、mic singly linked list,the node should contain,name,address,and,phone#,:,Write a function,create,to store three peoples information into the singly linked list;,Write a function,print,to print these information to the standard output;,Write a function,search,to find the telephone number of a contact input by name.,30,Assignment#10,31,Assignment#11,Define a,dynamic singly linked list,to store staffs information including,id,name,and,salary,.Please note that all the information should be input fro
- 温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。