Task Description
迴文函式
撰寫一個可以判斷迴文的函式。
Hint
isPalindrome.h
打上 function header 以及相關的設定。void isPalindrome(int x);
isPalindrome.c
撰寫程式碼後對應上傳。#include "isPalindrome.h"void isPalindrome(int x) { / add your code /}
main.c
這個檔案無法更改也無須上傳。123456789 #include <stdio.h>#include "isPalindrome.h" int main() { int x; scanf("%d", &x); isPalindrome(x); return 0;}
Input Format
測試資料為一整數x。
Output Format
若是迴文,印出true,
若不是迴文,印出false,
若x為負數,印出false。
Sample Input
1 121
Sample Output
1 true