C语言之if分支嵌套 输入两个数,判断大小并输出结果。 代码示例: #include <stdio.h> int main() { int a,b; printf("请输入两个数:"); scanf("%d%d",&a,&b); if(a!=b) if(a>b) { printf("%d>%d\n",a,b); } else { printf("%d<%d\n",a,b); } else { printf("%d=%d\n",a,b); } return 0; } 代码执行示例: