好文档 - 专业文书写作范文服务资料分享网站

C语言程序设计期末考试及答案

天下 分享 时间: 加入收藏 我要投稿 点赞

.

space=0; others=0; count(text);

printf(\字母,%d数字,%d空格,%d其它字符\\n\}

void count(char str[]) {

int i;

for(i=0;str[i]!='\\n';i++) {

if((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z')) alph++;

else if(str[i]>='0'&&str[i]<='9') digit++;

else if(str[i]==' ') space++; else

others++; } }

4. 写一函数,使给定的一个二维数组(3×3)转置,即行列互换。

#include

void x(int a[3][3])//x是行列互换的函数名 {

int i,j;

printf(\行列互换后:\\n\for(i=0;i<3;i++) {

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

printf(\ }

printf(\} }

void main() {

int sum[3][3],i,j;

printf(\请输入3*3的矩阵数:\for(i=0;i<3;i++) {

.

.

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

scanf(\ } }

x(sum); }

单纯的课本内容,并不能满足学生的需要,通过补充,达到内容的完善 教育之通病是教用脑的人不用手,不教用手的人用脑,所以一无所能。教育革命的对策是手脑联盟,结果是手与脑的力量都可以大到不可思议。

.

C语言程序设计期末考试及答案

.space=0;others=0;count(text);printf(\字母,%d数字,%d空格,%d其它字符\\n\}voidcount(charstr[]){inti;for(i=0;str[i]!='\\n';i++){i
推荐度:
点击下载文档文档为doc格式
0bdp58omva670et7c26i4qfr0177x6016mq
领取福利

微信扫码领取福利

微信扫码分享