31 Aralık 2012 Pazartesi

判斷基數偶數


輸入說明:
輸入一個整數

輸出說明:
輸出奇數或偶數

  1. #include <stdio.h>  
  2. #include <stdlib.h>  
  3.   
  4. int main(int argc, char *argv[])  
  5. {  
  6.     int a;   
  7.       
  8. scanf("%d",&a);       
  9.     if(a%2==0){  
  10.                printf("even\n");   
  11.                }  
  12.                else  
  13.                printf("odd\n");  
  14.                
  15.   system("PAUSE");    
  16.   return 0;  
  17. }  

Hiç yorum yok:

Yorum Gönder

Binary Conversion

Problem Description Convert two binary numbers into two decimal numbers and compute their sum. Your program has to convert two binary number...