正在加载图片...
制作:方斌 [案例12]由man(函数和1个其它函数max()构成的c语言程序 /*案例代码文件名:AL12.C*/ /*功能:由main(函数和1个其它函数max()构成的C语言程序示例*/ int max(int x, int y) d return(x>y? X: y;y maino d int num1, num2; printf( Input the first integer number: scanf( %d",&num1; printf("Input the second integer number: scanf(%d",&num2); printf(max=%d\n" max(num1, num2)) } 程序运行情况: Input the first integer number: 6 Input the second integer number: 9*J max=9 [程序演示]制 作:方 斌 [案例1.2] 由main()函数和1个其它函数max()构成的C语言程序。 /*案例代码文件名:AL1_2.C*/ /*功能:由main()函数和1个其它函数max()构成的C语言程序示例*/ int max(int x, int y) { return( x>y ? x : y ); } main() { int num1,num2; printf(“Input the first integer number: ”); scanf(“%d”, &num1); printf(“Input the second integer number: ”); scanf(“%d”, &num2); printf(“max=%d\n”, max(num1, num2)); } 程序运行情况: Input the first integer number:6←┘ Input the second integer number:9←┘ max=9 [程序演示]
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有