test.c
#include <stdio.h> int main() { int a = 1; int b = 2; int c = 2; if ((a > b) && (a > c)) { printf("%d\n", a); } else if (b > c) { printf("%d\n", b); } else { printf("%d\n", c); } system("pause"); return 0; }
运行结果如下:
test.c
#include <stdio.h> int main() { int a = 1; int b = 2; int c = 2; if ((a > b) && (a > c)) { printf("%d\n", a); } else if (b > c) { printf("%d\n", b); } else { printf("%d\n", c); } system("pause"); return 0; }
运行结果如下: