20250625 baekjoon
This commit is contained in:
parent
35cc79f065
commit
97f391f309
23
code_study/Baekjoon/c/1259.c
Normal file
23
code_study/Baekjoon/c/1259.c
Normal 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;
|
||||
}
|
||||
5
code_study/Baekjoon/js/1259.js
Normal file
5
code_study/Baekjoon/js/1259.js
Normal 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");
|
||||
}
|
||||
4
code_study/Baekjoon/python/1259.py
Normal file
4
code_study/Baekjoon/python/1259.py
Normal file
@ -0,0 +1,4 @@
|
||||
while True :
|
||||
s = input()
|
||||
if s=='0' : break
|
||||
print("yes" if s==s[::-1] else "no")
|
||||
Loading…
x
Reference in New Issue
Block a user