1、实验 6 数组一、一维数组实验2. 编程:输入长度为 10 的整型数组并输出;然后将其逆序存放后再输出。例如:Input 10 number: 0 1 2 3 4 5 6 7 8 9 After reversed: 9 8 7 6 5 4 3 2 1 0#includevoid main()int i, j, a10, t;printf(“Input 10 number: “);for(i=0; ivoid main()int i, n , max, min, a10, sum;float average;printf(“Input n (1 amax)max= i;if(ai void ma
2、in()int i, max, min;float a10, ave;printf(“请输入 10 个评委的打分:“);for(i=0, ave=0; iamax)max=i;if(aivoid main()int f1=1, f2=1, f3, i;printf(“%12d%12d“, f1, f2);for(i=3; ivoid main()int i;int fib40;fib0=fib1=1;for(i=2; ivoid main()int i, j, n;float a10, t;printf(“Input n: “);scanf(“%d“,if(n1 float a10, t, m
3、;printf(“Input n: “);scanf(“%d“, if(n1 break; for(i=n; i=p+1; i-) /*将插入位置之后的元素后移 */ai=ai-1; /*插入*/ap=m; printf(“插入%.2f 后:“, m); /*输出插入后结果*/for(i=0; i#define ROW 2#define COL 3int main()int aROWCOL=1,4,6,8,10,12;int i,j,temp;for(i=0;i=0;j-)aij=aij+1; /*调试时设置断点*/ /改为 aij+1=aij;ai0=temp; /*调试时设置断点*/for
4、(int i=0;ivoid main()int a1010=0; /设最多 10 层int i, j, n;printf(“请输入杨辉三角形的层数:“);scanf(“%d“, if(n10)printf(“层数超出范围“);return;for(i=0;ivoid main()int a34,i,j;printf(“请输入 3 X 4 整数矩阵:n“);for(i=0; ivoid main()int a1010, s10=0; /设定矩阵最大为 10 x 10int m, n, i, j;printf(“请输入矩阵的行数和列数:“);scanf(“%d%d“, if(m10 | n10)
5、printf(“行或列(110)值超出范围“);return;printf(“请输入 %d*%d 矩阵:n“,m,n);for(i=0; ivoid main()int a1010; /设定矩阵最大为 10 x 10int m, n, i, j, col, flag=0;printf(“请输入矩阵的行数和列数:“);scanf(“%d%d“, if(m10 | n10)printf(“行或列(110)值超出范围“);return; /退出程序printf(“请输入 %d*%d 矩阵:n“,m,n);for(i=0; iajcol) break;if(j=m) flag=1; /有鞍点printf(“i=%d, j=%d, saddle point:%dn“,i,col,aicol);