当输入10,11,12时,下面程序运行结果是 【6】 。#include <iostream>using namespace std;int main(){ int a,b,C,max; Cin>>a>>b>>c; max=a; if(max<b) max=b; if(max<c) max=c; cout<<max<<end1; return 0;
举一反三
- 有如下程序#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="<<max(a,b)<<endl; } A: max=3 B: max=4 C: max=5 D: max=6
- 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
- 写出下列程序的功能void main() {int a,b,max;cin>;>;a>;>;b; max=a;if(b>;max)max=b;max*=max; cout<;<;max; }
- 执行以下程序,如果输入为23 48 32,则输出结果为。#include<;stdio.h>;int max(int a,int b,int c);int main(){int a,b,c;scanf("%d%d%d",&a,&b,&c);printf("%d\n",max(a,b,c));return 0;}int max(int a,int b,int c){int max;max=a>;b?a:b;if(c>;max)max=c;return max;}
- int a=4,b=6; max (int a,int b) { int c; c=a>b?a:b; return c; } main() { int a=23; printf("max=%d",max(a,b)); } 程序运行结果是________