Advertisement
Maplewing

5/1 C: if-else

Apr 30th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3.    
  4.     int score;
  5.     scanf("%d", &score);
  6.    
  7.     /*
  8.         if如何判斷條件:
  9.         (O) 1, 2, 8, 100, -8, -100 ..... NOT 0
  10.         (X) 0
  11.        
  12.         運算 score >= 60:
  13.         score = 59: (score >= 60) => 0
  14.         score = 62: (score >= 60) => 1  
  15.     */
  16.    
  17.     if( score >= 60 ){
  18.         printf("PASS!");
  19.     }
  20.     else{
  21.         printf("NOT PASS!");
  22.     }
  23.    
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement