做c语言题目的电脑软件,c语言..题目.帮忙做一下

e37f12ac74800d9e5117f4898e105d24.png

1:

编译通不过;意思可能输出hello

3;

/*

* file:max-arrey.c

* ----------------

* This program is looked for the

* max number in 16 numbers and print the

* the max and the row.

* --------------------------------------

*/

#include

void main()

{

int a[16];

int i;

int row;

int max;

printf("please input 16 numbers:\n");

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

{

scanf("%d",&a[i]);

}

max=a[0];

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

{

if (a[i]>max)

{

max=a[i];

row=i;

}

}

printf("max=%d,row=%d\n",max,row);

getch();

}

3:

/*

* file:add.c

* ==========

* This program is used to

* add three numbers from

* using function print the

* result

*/

#include

void main()

{

int add(int * p1,int *p2,int *p3);

int a,b,c;

int * q1,* q2,*q3;

printf("The program is used to add three numbers:\n");

scanf("%d,%d,%d",&a,&b,&c);

q1=&a;q2=&b;q3=&c;

add(q1,q2,q3);

printf("the result is %d\n",add(q1,q2,q3));

getch();

}

int add(int * p1,int *p2,int *p3)

{

int z;

z=* p1 + * p2 + *p3;

return();

}

5;

struct stuff

{

int num;

char addr[30];

char sex;

int age;

int worktime;

int wage;

}

6:

/*

* file: add-arrey.c

* -----------------

* The program is used to add the arrey 对角线元素之和

* print the result

* ---------------------------------------------------

*/

#include

void main()

{

int i,j;

int t=0,tn=0;

int a[5][5];

int sum;

printf("entry a arrey:\n");

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

{

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

{

scanf("%d",&a[i][j]);

}

}

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

{

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

{

if (i==j)

{

t=t+a[i][j];

}

if (i+j==6)

{

tn=tn+a[i][j];

}

sum=t+tn+a[2][2];

}

}

printf("the result is %d\n",sum);

getch();

}

◆◆

评论读取中....

请登录后再发表评论!

◆◆

修改失败,请稍后尝试

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值