有如下程序#include [iostream] using namespace std; int max(int x,int y) { int z; if(x>y) z=x; else z=y; return z; } int main() { int a=3,b=5; cout<<"max="<A: max=3
B: max=4
C: max=5
D: max=6
B: max=4
C: max=5
D: max=6
举一反三
- 有如下程序:#include"stdio.h"int max(x,y)int x,y;{int z;if(x>;y) z=x;else z=y;return(z);}main(){extern int a,b;printf(”max=%d\n",max(a,b));}int a=3,b=5;运行结果为( )。 A: max=3 B: max=4 C: max=5 D: max=6
- 下列函数定义不正确的是( )。 A: int max() {int x,y,z; z=x>y?x:y; return z;} B: int max(x,y){ int z; z=x>y?x:y; return z;} C: int max(){ } D: int max(int x,int y) {int z; z=x>y?x:y; return(z);}
- 下面正确的是() #include <stdio.h> int main() { int max(int x,int y); int a,b,c; scanf("%d,%d",&a,&b); c=max(a,b); printf("max=%d ",c); return 0; } int max(intx,inty); { int z; if(x>y)z=x; else z=y; return(z); }
- 下列函数定义不正确的是( ) A: int max(){ } B: int max() {int x,y,z; z=x>y?x:y; return z;} C: int max(int x,int y) {int z;z=x>y?x:y; return(z);} D: int max(x,y){ int z; z=x>y?x:y; return z;}
- 10、以下程序的运行结果是( )#include <;stdio.h>;void main(){ int a=1,b=2,c;c=max(a,b);printf(“max is %d\n”,c);}max(int x, int y){ int z;z=(x>;y)? x:y;return(z);} A: max is 2 B: max is 1 C: max is 3 D: max is 12