20250625 baekjoon

This commit is contained in:
songyc macbook 2025-06-25 21:08:42 +09:00
parent 35cc79f065
commit 97f391f309
3 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#include <stdio.h>
#include <string.h>
int main(){
while(1){
char num[6];
scanf("%s",num);
if(num[0]=='0' && num[1]=='\0') break;
int len=strlen(num);
int flag = 1;
for(int i=0; i<len/2; i++) {
if(num[i] != num[len-i-1]) {
flag = 0;
break;
}
}
printf("%s\n",flag ? "yes" : "no");
}
return 0;
}

View File

@ -0,0 +1,5 @@
const n = require("fs").readFileSync(0,"utf8").toString().trim().split('\n');
for(let s of n) {
if(s==='0') break;
console.log((s.split('').reverse().join('') === s) ? "yes" : "no");
}

View File

@ -0,0 +1,4 @@
while True :
s = input()
if s=='0' : break
print("yes" if s==s[::-1] else "no")