C语言外语

上传人:青*** 文档编号:252669531 上传时间:2024-11-19 格式:PPTX 页数:34 大小:1.87MB
返回 下载 相关 举报
C语言外语_第1页
第1页 / 共34页
C语言外语_第2页
第2页 / 共34页
C语言外语_第3页
第3页 / 共34页
点击查看更多>>
资源描述
,单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,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 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.,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:,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,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 from 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(,最大公约数,)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 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 integers 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 five 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,decrement(,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 the 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 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 screen,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 array;,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 dynamic 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
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸设计 > 开题报告


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!