← 返回列表

计算机编程 if else if else 语句

计算机编程 if else if else 语句 #include <stdio.h> int main() { int x = 45; if( x > 95) { printf( "Student is brilliant\n"); } else if( x < 30) { printf( "Student is poor\n"); } else if( x < 95 && x > 30 ) { printf( "Student is average\n"); } }

计算机编程 if else if else 语句

#include <stdio.h>

int main() {

   int x = 45;

   if( x > 95) {
      printf( "Student is brilliant\n");
   }
   else if( x < 30) {
      printf( "Student is poor\n");
   }
   else if( x < 95 && x > 30 ) {
      printf( "Student is average\n");
   }
}

打开资源 ↗

交流与评论