云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 华中科技大学标准C语言程序设计及应用习题答案

华中科技大学标准C语言程序设计及应用习题答案

  • 62 次阅读
  • 3 次下载
  • 2025/5/2 12:03:34

文档仅供参考,不当之处,请联系改正。

/*Input two string*/ printf(\ gets(str1);

printf(\

gets(str2);

/*Get the end of str1*/ for(i=0; i<80; i++) {

if(str1[i]=='\\0')

break;

}

/*Copy str2 to str1*/

for(j=i,k=0; str2[k]!='\\0';k++,j++)

str1[j]=str2[k];

str1[i+k]='\\0';

puts(str1);

} 5.6

#include

struct student

2020年4月19日

29

文档仅供参考,不当之处,请联系改正。

{char name[20]; int score; }stu[5],stu1;

void main(void) { int i,j;

printf(\student's score and name(5),seperate using the

character of ',' :\\n\

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

scanf(\

/*sorting*/

for(i=0; i<5; i++) for(j=0; j<4-i; j++)

if(stu[j].score>stu[j+1].score)

{stu1=stu[j];stu[j]=stu[j+1];stu[j+1]=stu1;}

} 5.7

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

printf(\

#include main()

30

2020年4月19日

文档仅供参考,不当之处,请联系改正。

{ int a[3][3],i,j,m,n,o,p;

printf(\

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

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

scanf(\

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

{ m=(a[i][0]>a[i][1])? a[i][0]:a[i][1];

n=(m>a[i][2])? m: a[i][2]; }

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

{ o=(a[0][j]

2020年4月19日

31

文档仅供参考,不当之处,请联系改正。

p=(o

printf(\

else

printf(\ } 5.8

#include

void main(void)

{ int a[4][3],b[3][4],i,j;

for(i=0; i<4; i++) { for(j=0; j<3; j++) scanf(\

}

2020年4月19日

32

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

文档仅供参考,不当之处,请联系改正。 /*Input two string*/ printf(\ gets(str1); printf(\ gets(str2); /*Get the end of str1*/ for(i=0; i<80; i++) { if(str1[i]=='\\0') break; } /*Copy str2 to str1*/ for(j=i,k=0; str2[k]!='\\0';k++,j++) str1[j]=str2[k]; str1[i+k]='\\0'; puts

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com