写出下列程序的输出结果 #include <stdio.h> int main() { int *p1,*p2,*p,a,b; a=10; b=15; p1=a; p2=b; if(a<b) {p=p1;p1=p2;p2=p;} printf("a=%d,b=%dn",a,b); printf("%d,%dn",*p1,*p2); return 0; }
写出下列程序的输出结果 #include <stdio.h> int main() { int *p1,*p2,*p,a,b; a=10; b=15; p1=&a; p2=&b; if(a<b) {p=p1;p1=p2;p2=p;} printf("a=%d,b=%dn",a,b); printf("%d,%dn",*p1,*p2); return 0; }
参考答案和解析
20 0 20 0
相关考题:
有以下程序main(){ int a=1,b=3,c=5;int *p1=a, *p2=b, *p=c;*p =*p1*(*p2);printf("%d\n",c);}执行后的输出结果是A)1B)2C)3D)4
写出下列程序的执行结果。 swap(p1,p2) int*p1,*p2; {int p; p=*p1;*p1=*p2;*p2=p; } main() {int a,b,*p1,*p2; scanf("%d%d",a,B); p1=a;p2=b; if(a<B)swap(p1,p2); printf("\na=%d,b=%d\n",a,B); } 若a=7,b=8,则程序的运行结果为( )。
下面程序的输出结果是()。includeincludemain(){char p1[]="WHO",p2[]="who 下面程序的输出结果是( )。 #include<stdio.h> #include<string.h> main() {char p1[]="WHO",p2[]="who",str[50]="xyz"; strcpy(str+1,strcat(p1,p2)); printf("%s",str);}A.xyzWHOwhoB.zWHOwhoC.zWHOwhoD.xWHOwho
执行以下程序后,a,b的值分别为main(){ int a,b,k=4,m=6,*p1=k,*p2=m;a=p1==m;b=(*p1)/(*p2)+7;printf("a=%d\n",A.;printf("b=%d\n",B.;}A.-1,5B.1,6C.0,7D.4,10
下列程序的输出结果是______。 main() {int a=2,b=4,c=6; int*p1=a,*p2=b,*p; *(p=int*p1=a,*p2=b,*p;*(p=C) =*p1*(*p2);printf("%d\n",c);}
下列程序的运行结果是【 】。 include include void main() {char * a[5 下列程序的运行结果是【 】。include<iostream. h>include<string. h>void main(){char * a[5]={"stuent","worker","teacher","soldier"," peasant"};char * p1, * p2;p1=p2=a[0]for(int i=0;i<5;i++){if(strcmp(a[i],p1)>0)p1=a[i];if(strcmp(a[i],p2)<0)p2=a[i];}cout<<p1<<","<<p2<<endl;}
设有以下程序: include using namespace std; int main() {inta,b,k:4,m=6,*p1=k 设有以下程序:include<iostream>using namespace std;int main(){int a,b,k:4,m=6,*p1=k,*p2=m;a=p1==m;b=(*p1)/(*p2)+7;cout<<a<<b<<end1;return 0;}执行该程序后,a的值为【 】,b的值为【 】。
以下程序includeincludemain(){char*p1="abc",*p2="ABC",str[50]="xyz", s 以下程序 #include<stdio.h> #include<string.h> main() { char*p1="abc",*p2="ABC",str[50]="xyz", strcpy(str+2,strcat(p1,p2)); printf("%s\n",str); } 的输出是______。A.xyzabcABCB.zabcABCC.yzabcABCD.xyabcABC
下列程序的输出结果是______。main(){ static int num[5]=}1,3,5,7,9};int*p1,**p2;p1=num;p2=p1; printf("%d,",*(++p1)); printf("%d\n",**p2); }A.3,1B.3,3C.1,1D.1,3
分析下面的程序 main() { int*p1,*p2,*p; int x=4,y=6; p1=x;p2=y; if(x<y) {p=p1;p1=p2;p2=p; } printf("%d,%d,",*p1,*p2); printf("%d,%d\n",x,y); } 程序的输出结果为_______。A.6,4,4,6B.4,6,6,4C.4,6,4,6D.6,4,6,4
有以下程序include stcli0.hmain( ){ int a,b,k,m,*p1,*p2; k=1,m=8; p1=k,p2=stcli0.hmain( ){ int a,b,k,m,*p1,*p2;k=1,m=8;p1=k,p2=m;a=/*p1 -m; b=*p1+*p2+6;printf(”%d ”,a); printf(”%d\n”b);}编译时编译器提示错误信息,你认为出错的语句是A) a=/*p1- m;B)b=*p1+*p2+6;C)k=1,m=8;D)p1=k, p2=&m;
以下程序includeincludemain(){ char*p1="abc",*p2=-"ABC", str, [50]="xy 以下程序#include<stdio.h>#include<string.h>main(){ char*p1="abc",*p2=-"ABC", str, [50]="xyz"; strcpy(str+2,strcat(p1,p2)); printf("%s\n", str);}A.xyzabcABCB.zabcABCC.yzabcABCD.xyabcABC
分析下列程序:includemain(){int*p1,*p2,*p;int a=6,b=9;p1=a;p2=b;if(a 分析下列程序: #include<stdio.h> main() { int*p1,*p2,*p; int a=6,b=9; p1=a;p2=b; if(a<b){p=p1;p1=p2;p2=p;} printf("%d,%d",*p1,*p2); printf("%d,%d",a,b); } 程序的输出结果为( )。A.9,6 6,9B.6,9 9,6C.6,9 6,9D.9,6 9,6
分析下列程序: include main() {int*p1,*p2,*p; inta=6,b=9; p1=a;p2=b; if 分析下列程序:#include<stdio.h>main(){ int*p1,*p2,*p;inta=6,b=9;p1=a;p2=b;if(a<B) {p=p1;p1=p2;p2=p;}printf("%d,%d",*p1,*p2) ;printf("%d,%d",a,B) ;}程序的输出结果为( )。A.9,6 6,9B.6,9 9,6C.6,9 6,9D.9,6 9,6
下列程序的运行结果是()。 include main() {static char a[]="Languagef",b[]="program 下列程序的运行结果是( )。#include<stdio.h>main(){ static char a[]="Languagef",b[]="programe";Char*p1,*p2;int k;p1=a;p2=b;for(k=0;k<=8;k++)if(*(p1+k)==*(p2+k))printf("%c",*(p1+k));}A.gaeB.angC.programD.有语法错
下面程序的输出结果是includeincludevoid main( ){char p1[10],p2[10]s 下面程序的输出结果是 #include<iostream.h> #include<string.h> void main( ) { char p1[10],p2[10] strcpy(p1,"abc"); strcpy(p2,"ABC"); char str[50]="xyz"; strcpy(str+2,strcat(p1,p2));A.xyzabcABCB.zabcABCC.xyabcABCD.yzabcABC
写出结果void foo(int p1[]){*p1 += 5;}void bar(int p2[]){p2[1] = 15;}void main(){int a[]={3,4,5};int b[]={3,4,5};int *p2;p2=a[1];bar(p2);printf("%i %i %i\n",a[0],a[1],a[2]);p2=b[0];p2++;foo(p2);bar(p2);printf("%i %i %i\n",b[0],b[1],b[2]);}
分析下列程序:includemain(){int *p1,*p2,*p; int a=6,b=9; p1=a;p2=b; if( 分析下列程序: #include<stdio.h> main() { int *p1,*p2,*p; int a=6,b=9; p1=a;p2=b; if(a<b){p=p1;p1=p2;p2=p;} printf("%d,%d",*p1,*p2); printf("%d,%d",a,b); } 程序的输出结果为( )。A.9,66,9B.6,9 9,6C.6,9 6,9D.9,69,6
下面程序的输出结果为______。includemain(){char p1[7]="abc",p2[]="ABC",str[50]="x 下面程序的输出结果为______。 #include<string.h> main() { char p1[7]="abc",p2[]="ABC",str[50]="xyz"; strcpy(str,strcat(p1,p2)); printf("%s",str); }A.xyzabcABCB.abcABCC.xyzabcD.xyzABC
下面程序的输出结果为______。 include main() { char p1[7]="abc",p2[]="ABC",str[50 下面程序的输出结果为______。 #include<string.h> main() { char p1[7]="abc",p2[]="ABC",str[50]="xyz"; strcpy(str,strcat(p1,p2)); printf("%s",str); }A.xyzabcABCB.abcABCC.xyzabcD.xyzABC
下面程序的输出是______。 fun(char *s,int p1,int p2) { char c; while(p1<p2) { c=s[p1];s[p1]=s[p2];s[p2]=c;p1++;p2--;} } main() { char a[]="ABCDEFG",k,*p; fun(a,0,2);fun(a,4,6); printf("%s\n ",a); }A.ABCDEFGB.DEFGABCC.GFEDCBAD.CBADGFE
有以下程序: main() {int a=1,b=3,c=5; int*p1=&a,*p2=&b,*p=&c; *p=*p1*(*p2); printf("%d\n",C); } 执行后的输出结果是( )。A.1B.2C.3D.4
若有如下程序: sub(int * t,int n) {int *p1, *p2; for(p1=t,p2=t;p1-t<n;p1++) if(*p1<*p2) p2=p1; return(*p2);} main() {int a[9]={9,36,19,39,26,5,6,33,15}; printf("%d\n",sub(a,9));} 则程序运行后的输出结果是( )A.5B.9C.15D.39
以下程序运行后的输出结果是______。 main() { char a[]="ABCDEFGH",b[]="abCDefGh"; char*p1,*p2;int k; p1=a;p2=b; for(k=0;k<=7;k++) if*(p1+k)==*(p2+k))printf("%c",*(p1+k)); printf("\n"); }A.ABCDEFGB.CDGC.abcdefghD.abCDefGh
以下程序 include include main() { char*p1="abc",*p2="ABC",str[50]="xy 以下程序 #include<stdio.h> #include<string.h> main() { char*p1="abc",*p2="ABC",str[50]="xyz"; strcpy(ar+2,strcat(p1,p2)); printf("%s\n",str); } 的输出是______。A.xyzabcABCB.zabeABCC.yzabcABCD.xyabcABC
单选题有以下程序:#include #include #include main(){ char*p1,*p2; p1=p2=(char*)malloc(sizeof(char)*10); strcpy(p1,malloc); strcpy(p2,p1+1); printf(%c%c, p1[0], p2[0]);}程序的运行结果是( )。AaaBmaCamDmm
单选题有以下程序#include main(){ char *p1 = 0; int *p2 = 0; float *p3 = 0; printf(%d,%d,%d, sizeof(p1), sizeof(p2), sizeof(p3));}程序运行后的输出结果是( )。A4,4,4B1,4,8C0,0,0D1,2,4