Toggle navigation
Courses
Questions
Tags
Users
AC 20170105 期末 第三題
0
like
0
dislike
4.5k
views
請設計一個程式,使用者會輸入一個字串,請判斷該字串是否為回文(palindrome)。
輸入範例1:
12321
輸出範例1:
12321 is a palindrome
輸入範例2:
apple
輸出範例2:
apple is not a palindrome
[Exercise]
Coding (C)
-
asked
Jan 5, 2017
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 20980 -
Available when:
Unlimited
-
Due to:
Unlimited
reshown
Jan 5, 2017
by
Shun-Po
|
4.5k
views
comment
Please
log in
or
register
to add a comment.
43
Answers
0
like
0
dislike
Hidden content!* * ** * *** * * *
* * * * ** * * * ** **
** * ** * ** *
* * ** ** * ** ** *
** * **** *
* ** * ( void )
{
* ** * * *
* ** * ** * ** *
* ** * != * * **** ** * ** * is not a * * * ** * *
***
if * * != ** * **** ** ** * ** * is not a * * * * ***
*
* ** ** * is a *** * * * ** * *
* * 0;
}
answered
Jan 5, 2017
by
410523022
(
-276
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!#include <stdio.h>
#include <string.h>
int is_palindrome(char *s)
{
* ** * * * * * ** * i, len;
** * * * * * * * * * * = strlen(s);
* ** * * *** * ** * * * = 0; i < (len /2); i++)