#include <stdio.h> int main() { int a; a = 2; //第一种 if(a == 2) { printf("a number is 2"); } //第二种 if(a == 2) { printf("a number is 2"); } else { printf("a number not 2"); } //第三种 if(a == 2) { printf("a number is 2"); } else if (a == 3) { printf("a number is 3"); } else { printf("a number not is 2 or 3"); } return 0; }