Manipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand{
int workover(int i); int reset(int i); int i=HIGH; reset(i/2.5);
printf(\ reset(i=i/3);
printf(\ reset(i/2);
printf(\ workover(i);
printf(\ return 0; }
workover(int i); {
i=(i%i++)*((i*i)/(2*i)+4); printf(\ return (i); }
reset(int i); {
i=i<=CHANGE?LOW:HIGH++; return (i); }
(3) 分析、编辑并执行以下程序,如果有错,请指出其错误原因,同时需要指出各个变量的存储属性。
/*****file1.c*****/ int last(void); int new(int); int reset(void); exter int i; int main(void) {
int i,j; i=reset();
for (j=1;j<=3;j++) {
printf(“i=%d\\tj=%d\\n”,i,j); printf(“next(i)=%d\\t”,next(i)); printf(“last(i)=%d\\n”,last());
printf(“new(i+j)=%d\\n”,new(i+j)); }
int next(void) {
return (i++); }
manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his twcontent control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that iss: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing hereas now it is successfully developed into industrial control computer used as a central collection and distribution system o great advantageused to control, wManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand return 0; }
/*****file2.c*****/ static int i=10; fast(void) {
rturn (i-=1_); }
new(int i) {
static int j=-5; return (i=j+=++i); }
/*****file3.c*****/ extern int i; reset() {
return (i); }
3.预编译命令实验。具体实例如下: (1) 一般宏替换实验(教材例7-5);
(2) 带参数的宏替换(教材例7-7~例7-12,习题7-8和习题7-9); (3) 习题7-11和习题7-12;
(4) 文件包含(#include \和#include <>)。 实验准备:
(1) 编写所选实验题目的程序代码和流程图; (2) 检查源程序并给出其可能的运行结果说明。 实验步骤:
(1) 上机验证所选题目,并做相应测试和分析; (2) 进行实验分析;
(3) 总结基于函数、宏等技术的模块化程序设计和实现方法及其经验; (4) 编写实验报告。 实验结果:
(1) 根据测试目标写出测试报告; (2) 测试结果分析说明; (3) 测试程序代码清单。
实验七 数组(6学时)
实验目的:
manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand(1) 掌握C语言环境下数组的声明、定义和使用方法,包含其初始化、赋值、输入、输出和处理方法;
(2) 掌握字符数组和字符串数组的使用方法;
(3) 了解数组作为函数参数或返回值的传递和使用方法。 实验内容:(第1题必做,第2、3、4任选一个)
1.数组的基本使用方法实验。包含数组的声明方法、初始化方法、输入、输出方法、元素的引用方法以及数组作为函数参数的使用方法。
(1) 一维数组的声明、初始化及引用方法; (2) 二维数组的声明、初始化及引用方法;
(3) 字符数组和字符串数组的初始化及引用方法的差异分析; (具体实例参见教材实例)
测试函数声明和定义方法时,可以从以下几个方面进行测试:
1) 用已声明和定义的变量作为数组大小的声明; 2) 用已声明的const变量作为数组变量大小的声明; 3) 用宏名表示声明数组变量的大小; 4) 用表达式计算结果作为数组变量的大小; 5) 用宏的运算结果表示声明数组变量的大小。
(4) 分别按行序和列序顺序返回一个二维数组中各个元素的内存空间地址
值,以观察数组元素在计算机内存中的排列规律。 2.一维数组的应用。具体实例如下:
(1) 有一个数组大小为10,内放10个数,请找出其中对大和最小元素来,并
分别将其与数组第1个元素和最后1个元素交换。
(2) 有17个人围成一圈,其编号分别为1到17,如果从1号开始报数,凡报到7
的倍数的人必须离开该圈子,然后再接着往下数,直到最后只剩一个人为止。请问最后一个人原来的位置序号是多少?(扩展问题:请将每个人按出列顺序重新排列后,其排列的顺序是什么?) 3.二维数组应用。具体实例如下:
(1) 输入一个n*n的矩阵。1) 试求除开对角线上元素之外的元素之和;2) 求
每行中与相应对角线元素不同的元素之和;
(2) 有n个学生,m门功课。要求:1) 找出成绩最好的学生及其对应的课程
号码;2) 求全部同学每门课程的平均成绩; 4.字符数组应用。具体实例:
manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand (1) 有三行文字,请找出其中空格的个数,并统计单词的个数。(注:单词
以一个或多个空格为间隔。如果一个单词刚好在行末结束,则下一行开头应该有空格,包含句号和逗号后面也应该有空格!)
(2) 输入n个国家的名字,要求按照字母的先后顺序排序,并输出排序前后的结果。 实验准备:
(1) 编写所选实验题目的程序代码和流程图; (2) 检查源程序并给出其可能的运行结果说明。 实验步骤:
(1) 上机验证所选题目,并做相应测试和分析; (2) 进行实验分析;
(3) 总结基于数组的程序设计和实现方法及其经验; (4) 编写实验报告。 实验结果:
(1) 根据测试目标写出测试报告; (2) 测试结果分析说明; (3) 测试程序代码清单。
实验八 指针(4学时)
实验目的:
(1) 掌握C语言环境下指针的声明、定义和使用方法; (2) 掌握指针和变量以及指针和数组的关系; (3) 掌握指针、数组之间的关系; (4) 掌握指针、函数之间的关系。 实验内容:
1.熟悉指针的基本使用方法。
(1) 请仔细分析以下程序段,并上机测试运行结果,对测试结果进行分析说明。
1) 程序段一:
int main() {
int i=3,j=6,k=9;
printf(“i=%d j=%d k=%d\\n”,*(&i),j,k); return 0; }
2) 程序段二:
manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begandint main(void) {
int nA,*p; float fB,*q; p=&nA; q=&fB;
scanf(“%d,%f”, p, q); *p=nA*(*q);
printf(“nA is %d, p is %d and *p is %d\\n”, nA, p,*p); printf(“fB is %f, q is %d and *q is %d\\n”, nA, q,*q); printf(“p+1=%d q+1=%d\\n”,p+1,q+1); return 0; }
3) 程序段三:
int main(void) {
int nA,*p,**q,***r; p=&nA;q=&p;r=&q;
printf(“Please input nA::\\n”); scanf(“%d”,**r);
printf(The results are :”);
printf(“nA’ value is %d,%d,%d,%d\\n”,nA,*p,**q,***r); printf(“nA,p,q,r’s value is %d,%d,%d,%d\\n”,nA,p,q,r); return 0; } (2) 设计一个C语言程序,以测试以下表达式的运算顺序。
2. 想使指针变量pt1指向变量nA和nB中的大者,pt2指向其小者,以下程序能否实现此目的?为什么?如果不行,请给出实现的方法。
void swap(int *pt1,int *pt2) {
int *p;
p=p1;p1=p2;p2=p; }
int main(void) {
int nA,nB; int *pt1,*pt2;
scanf(“%d,%d”,&nA,&nB); pt1=&nA;pt2=&nB;
if (nA 3.请仔细分析教材例9-2、9-3、9-6~9-11,上机调试之。记录并分析程序运行结 manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that is