皮皮学,免费搜题
登录
搜题
【简答题】
编程题: /*------------------------------------------------------- 【程序设计】 --------------------------------------------------------- 题目:将主函数main()中字符数组IPb中的32个'0','1'字符看做 一个32位的二进制形式的IP地址,将其转换为4个十进制数 整数形式的IP地址。并以点分十进制记法(XXX.XXX.XXX.XXX) 输出IP地址。同时指出该地址所属的地址类。IP地址类见 下面分类: A类地址:1.0.0.1-126.255.255.254 B类地址:128.0.0.1-191.255.255.254 C类地址:192.0.0.1-223.255.255.254 D类地址:224.0.0.0-239.255.255.255 E类地址:240- 编写程序: 1. 编写函数void btod(char ipb[],int ipd[]),将字符 数组ipb中由字符组成的二进制IP地址转换为十进制IP 地址,存入数组ipd中。 2. 编写函数char classto(int ip),依据参数ip,判断 IP所属的地址类,函数返回所属类的字符('A'~'E')。 --------------------------------------------------------- 注意:请勿改动主函数main()中的任何语句。 -------------------------------------------------------*/ #include #include #include void btod(char ipb[],int ipd[]){ /**********Program**********/ /********** End **********/ } char classto(int ipd){ /**********Program**********/ /********** End **********/ } int main(){ char IPb[33]="11000000111011001110001110000011",c; int IPd[4]={0},i; FILE *fp; btod(IPb,IPd); c=classto(IPd[0]); if((fp=fopen("DATA.TXT","w"))==NULL){ printf("File open error\n"); exit(0); } for(i=0;i<3;i++){ printf("%d.",IPd[i]); fprintf(fp,"%d.",IPd[i]); } printf("%d\t",IPd[3]); fprintf(fp,"%d\t",IPd[3]); printf("%c类地址\n",c); fprintf(fp,"%c类地址\n",c); fclose(fp); return 0; }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】已知FM信号表达式s(t)=10cos[10000πt+5sin100πt],频偏常数为5rad/(s*V),基带信号是
A.
sin100πt
B.
100πcos100πt
C.
5cos100πt
D.
不能确定
【多选题】需去毛的药物是
A.
桔梗、地榆
B.
鹿茸、枇杷叶
C.
狗脊、马钱子
D.
金樱子、石韦
E.
香附、骨碎补
【单选题】Read the following sentences and answer the question below.Meanwhile, Chinese people, especially the young, are suffering from so-called knowledge anxiety. In such a rapidly changing society, people a...
A.
The young Chinese are afraid to be left out by the fast changing society.
B.
The education level has been greatly improved.
C.
The society is changing too quickly for people to understand.
D.
More and more educated people rush into big cities.
【单选题】What kind of thesis is likely if you have read the whole work, summarized it, looked for nearly matching sentences in the text you are reading, and haven't found a sentence that sums up the whole text...
A.
an implicit thesis
B.
an explicit thesis
C.
a topic sentence
【判断题】Even if you have read the book in the reading list, you can not pass the exam. 上面这个句子even if 的作用是强调后面陈述内容的真实性。
A.
正确
B.
错误
【多选题】传统认为需去毛的药物有()
A.
骨碎补
B.
鹿茸
C.
枇杷叶
D.
金樱子
E.
狗脊
【判断题】常数100不是表达式。
A.
正确
B.
错误
【多选题】入汤剂需去毛的药物是
A.
骨碎补
B.
石韦叶
C.
鹿茸
D.
枇杷叶
E.
金樱子
【多选题】需要去毛的药物有
A.
鹿茸
B.
枇杷叶
C.
狗脊
D.
金樱子
E.
骨碎补
【单选题】下列项目投资指标中,没有考虑资金时间价值的指标是:( )。
A.
净现值
B.
现值指数
C.
内部收益率
D.
平均报酬率
相关题目: