调用fun函数求5行5列矩阵所有元素之和。编写fun函数。#include#defineM5intfun(inta[M][M]){/**********Program**********//**********End**********/}main(){inta[M][M]={{1,3,5,7,9},{2,4,6,8,10},{2,3,4,5,6},{4,5,6,7,8},{1,3,4,5,6}};intsum;sum=fun(a);printf("s=%d\n",sum);}
查看答案
调用fun函数求5行5列矩阵主对角线元素之和。#include#defineM5intfun(inta[M][M]){/**********Program**********//**********End**********/}main(){inta[M][M]={{1,3,5,7,9},{2,4,6,8,10},{2,3,4,5,6},{4,5,6,7,8},{1,3,4,5,6}};intsum;sum=fun(a);printf("s=%d\n",sum);}
从键盘输入一个字符串放在字符数组ss中,假设ss的大小是30,求输入的字符串中字符为'a'的个数。#includeint fun(char ss[]){}main(){char ss[30];int i,n;gets(ss);n=fun(ss) ;printf("%d\n",n);}
当设置串行口工作为方式2时,采用_________语句
A. SCON=0x80
B. PCON=0x80
C. SCON=0x10
D. PCON=0x10
串行口工作在方式0时,串行数据从________输入或输出
A. RI
B. TXD
C. RXD
D. REN