阅读程序: main() { char strl[]="how do you do",str2[10]; char * p1=strl,* p2=
阅读程序: main() { char strl[]="how do you do",str2[10]; char * p1=strl,* p2=str2; scanf("%s”,p2); printf("%s”,p2); printf("%s\n",p1); } 运行上面的程序,输入字符串HOW DO YOU DO 则程序的输出结果是【 】。
阅读程序: main() { char strl[]="how do you do",str2[10]; char * p1=strl,* p2=str2; scanf("%s”,p2); printf("%s”,p2); printf("%s\n",p1); } 运行上面的程序,输入字符串HOW DO YOU DO 则程序的输出结果是【 】。
A.a ,z ,25
B.A,Z,25
C.a,z,\
D.97,122,25
阅读程序: include<string.h> include<strdio.h> strle(char a[],char b[]) {int num=0,n=0; while(*(a+num)!=0)num+ +; while(b[n]) { * (a+num)=b[n];num+ +;n+ +;} return(num); } main() {char strl[81],str2[81],* p1=strl,*p2=str2; gets(p1);gets(p2); prinf("%d\n",strle(p1,p2)); } 运行上面的程序,如果从键盘上输入字符串qwerty和字符串abcd,则程序的输出结果是【 】。
4. 阅读程序,分析程序实现的功能(设系统晶振为12MHz)。 #include <reg51.h> unsigned char i; sbit P1_1=P1^1; void main() { i=0; TMOD=0x10; TH1=(65536-10000)/256; TL1=(65536-10000)%256; EA=1; ET1=1; TR1=1; while(1); } void timer1_int(void) interrupt 3 { TH1=(65536-10000)/256; TL1=(65536-10000)%256; i++; if(i==2) P1_1=0; else if(i==3) { i=0; P1_1=1; } }
A.24
B.48
C.84
D.28
结合硬件连接图,阅读程序,分析其功能。#include<reg51.h> sbit AddA = P2^0 sbit AddB = P2^1 sbit AddC = P2^2 sbit AdSta = P2^3 sbit AdOE = P2^4 sbit AdEOC = P3^2 sbit DAXFER = P2^5 void main() { unsigned char i; unsigned char temp=0,max=0; while(1) { for(i = 0; i < 8; i ++) { P2 = i; ADSta = 1; _nop_();_nop_(); ADSta = 0; while(!ADEOC == 1); while(!ADEOC == 0); ADOE = 1; temp = P0; ADOE = 0; if(temp > max) max = temp; } P0 = max; DASta = 0; _nop_(); DASta = 1; } }
阅读程序。阅读下列C++程序(共2个文件)。阅读后请说明程序的功能,并对每条语句进行注释,说明其作用。添加注释并提交源程序(请粘贴源代码或屏幕截图,不要上传附件)。 // 程序文件:1.cpp #include <iostream> using namespace std; void fun(int x) { if (x < 0) { cout << ‘-‘; x = -x; } while (x != 0) { cout << x%10; x /= 10; } cout << endl; } void fun(char *str) { int N = 0; while (str[N] != ‘\0’) N++; for (int n = N-1; n >= 0; n--) cout << str[n]; cout << endl; } // 程序文件:2.cpp #include <iostream> using namespace std; extern void fun(int x); extern void fun(char *str); int main() { fun(-2015 ); fun(“-2015” ); return 0; }
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!