#include <stdio.h>
int main() {
int num;
printf("enter a number: ");
scanf("%d",&num);
if (num%3==0)
printf("It can be divided by 3.");
else
printf("It cannot be divided by 3.");
return 0;
}
之前我們學過如何於 C 程式內輸入數目字,但如要輸入字串,例如姓名,又要如何處理呢 ? 跟其他大部分電腦程言不一樣, C 並沒有一個字串的變數數據類型 (variable data type) , C 是使用字元 (character) 及變數陣列 (array)...
沒有留言:
張貼留言