2019年6月25日 星期二

C語言(online c) 寫簡單的 程式 ( 輸入一個數值判斷數值為偶數或奇數 )

C語言(online c) 寫簡單的 程式 ( 輸入一個數值判斷數值為偶數或奇數 )

#include<stdio.h>
#include<math.h>
int main()
{
    int x, f, a, b;
    printf("請輸入一數字( 1~200):\n");
    scanf("%d", &x);
    printf("你輸入的 N=%d\n", x);
    printf("\n1. 此數字是:");

    if (x % 2 == 0)
        printf("偶數");
    else
        printf("奇數");
 
    return 0;     
}     


沒有留言:

張貼留言

  清除項目編譯快取 執行 flutter clean 重新取得套件依賴 執行 flutter pub get 完整重新編譯並執行 flutter run 1. 新增專案套件 (pubspec.yaml) 在 Flutter 專案根目錄下的 pubspec.yaml 中,新增 ...