Skip to content

koreaioi/studyDataStructure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#알고리즘 공부를 위함

백준 1259번 [백준1259번](src/solvedac/ac1259.java)
package solvedac;
import java.util.*;


public class ac1259 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while (true) {
            int num = sc.nextInt();
            String answer = "yes";
            if(num ==0) return;

            String str = Integer.toString(num);
            for (int i = 0; i < str.length() / 2; i++) {
                if(str.charAt(i)!= str.charAt(str.length()-i-1)) answer = "no";
            }
            System.out.println(answer);
        }

    }
}
DFS ```java
public void DFS(int start){
    ch[start] = 1;
    sb.append(start + " ");

    for(int i = 1;i<=node;i++){
        if(arr[start][i] == 1 && ch[i]==0]) DFS(i);
    }          
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages