正在加载图片...
清华大学出版社 TSINGHUA UNIVERSITY PRESS 44用f语句实现选择结构程序设计 2语句的嵌套 4)i语句嵌套的使用原则 【例49】用条件表达式,输出两个数中的大数。 include<stdio.h> void main( input two nunbers: 4, 6 max=6 int a, b, max, Press any key to continue printf("input two numbers: ) scanf( %d, %d", &a, &b) printf("max=%dn",a>b?a: b) 29 返回本章首页29 返回本章首页 4.4 用if语句实现选择结构程序设计 2.If语句的嵌套 4)if语句嵌套的使用原则 【例4_9】用条件表达式,输出两个数中的大数。 #include<stdio.h> void main() { int a,b,max; printf("input two numbers:"); scanf("%d,%d",&a,&b); printf("max=%d\n",a>b?a:b); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有