例3.1求两个数中较大的值和较小的值 include <iostream. h> void maino int a, b. max. min: a=10 b=20 if(a>b) max-a min=b else 程序运行结果为: max= 20 max= b min =10 mine a cout < max="<< max < endl; cout < min min < end:例3.1 求两个数中较大的值和较小的值 #include <iostream.h> void main() { int a,b,max,min; a=10; b=20; if(a>b) { max = a; min = b; } else { max = b; min = a; } cout << "max = " << max << endl; cout << "min = " << min << endl; } 第3章 C++控制语 句 程序运行结果为: max = 20 min = 10