#45346: c語言簡單最快解


a09387795119@gmail.com (gonnnm)

School : No School
ID : 157668
IP address : [182.233.24.152]
Last Login :
2025-05-11 09:14:35
a022. 迴文 | From: [182.233.24.152] | Post Date : 2025-02-16 22:34

#include<stdio.h>
void repeat(char str[],int n){
int i=0,ans=0,temp=n;
for(i=0;i<n;i++){
temp--;
if(str[i]==str[temp]){
ans++;
}
}
if(ans==n){
printf("yes");
}else{
printf("no");
}
}
int main(void){
char str[100];
int i,j,n=0;
scanf("%[^\n]",str);
for(i=0;str[i]!='\0';i++){
n++;
}
repeat(str,n);
return 0;
 
ZeroJudge Forum