001、相等运算符
==
!=
002、关系运算符
>
>=
<
<=
003、条件运算符
a ? b:c
[root@localhost test]# ls test.c [root@localhost test]# cat test.c #include <stdio.h> int main(void) { int n1,n2; puts("please input two integers."); printf("n1 = "); scanf("%d", &n1); printf("n2 = "); scanf("%d", &n2); int max; max = (n1 > n2) ? n1:n2; printf("max is %d\n", max); return 0; } [root@localhost test]# gcc test.c -o kk [root@localhost test]# ls kk test.c [root@localhost test]# ./kk please input two integers. n1 = 8 n2 = 3 max is 8 [root@localhost test]# ./kk please input two integers. n1 = 2 n2 = 7 max is 7
.
标签:语言,max,几种,运算符,test,n1,n2,root,localhost From: https://www.cnblogs.com/liujiaxin2018/p/18395798