指针编程(指针编程的优点)

2023-11-20 05:40:11 数码极客 bianji01

 

C语言指针编程

#include?int?max(int?a,?int?b)return?a>b?a:b;int?min(int?a,?int?b)return?a

C语言指针编程题,求大神解答

#include"stdio.h"

voidfun(inta[][6],intn,intm,int*odd,int*even)

{inti,j;

*odd=*even=0;

for(i=0;i

for(j=0;j

a[i][j]%2?*odd+=a[i][j]:*even+=a[i][j];

intmain()

{intn,m,i,j,a[5][6],odd,even;

for(i=0;i<5;i++)

{for(j=0;j<6;j++)

{a[i][j]=i*6+j+1;

printf("%4d",a[i][j]);

printf("\n");

fun(a,5,6,&odd,&even);

printf("奇数之和=%d\n偶数之和=%d\n",odd,even);

return0;

声明:易趣百科所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系315127732@qq.com
广告位招租
横幅广告