正在加载图片...
int i,j,row=0,coum=0,max; inta3][4]={1,2,3,4},{9,8,7,6{-10,10,-5,2}: max=a[0][0 for(i=0;i<=2;i++) for(j=0;j<=3;j++) if (a[i][j]>max) {max=a[i][j];row=i;colum=j) printf("max=%d,row=%d,colum=%d\n",max,row,colum); } 要求 ①调试运行程序 ②程序中画线的语句能否改为f语句。 ③数组的赋值能否换另一种方式赋值,是什么? (3)有3个字符串,要求找出其中最大者。 程序如下: include <stdio.h> include<string.h> main() char string[20]; char str[3][20]; int i; for(i=0;i<3;i+) gets(str[i]); if(strcmp(str[0],str[i]>0)strcpy (string,str[0]); else strcpy(string,str[i]); if(strcpy(str[2],string)>0)strepy(string,str[i]), printf(Anthe largest string is:\n",string); } 要求 ①采用一维叔祖来处理,编写程序并运行程序 ②程序中使用函数的意思int i,j,row=0,coum=0,max; int a[3][4]={{1,2,3,4},{9,8,7,6},{-10,10,-5,2}}; max=a[0][0]; for (i=0;i<=2;i++) for(j=0;j<=3;j++) if (a[i][j]>max) { max=a[i][j];row=i;colum=j;} printf(“max=%d,row=%d,colum=%d\n”,max,row,colum); } 要求 ① 调试运行程序 ② 程序中画线的语句能否改为 if 语句。 ③ 数组的赋值能否换另一种方式赋值,是什么? ⑶有 3 个字符串,要求找出其中最大者。 程序如下: # include <stdio.h> # include<string.h> main( ) { char string[20]; char str[3][20]; int i; for (i=0;i<3;i++) gets(str[i]); if (strcmp(str[0],str[i]>0) strcpy (string,str[0]); else strcpy(string,str[i]); if (strcpy(str[2],string)>0) strcpy(string,str[i]); printf(“\nthe largest string is:\n”,string); } 要求: ① 采用一维叔祖来处理,编写程序并运行程序 ② 程序中使用函数的意思
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有