분류 전체보기267 [알고리즘 문제] Matrix Upside Down 2 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int count = 0; int[][] ary = new int[10][10]; for (int a = 0; a < 10; a++) { // 입력받은 배열로 초기화 해준다. for (int b = 0; b < 10; b++) { ary[a][b] = sc.nextInt(); } } for (int i = 0; i < n; i++) { for (int x = 0; x < 10; x++) { // x부분을 뒤집는 부분 if (ary[i][x] == .. 2019. 3. 26. [알고리즘 문제] Matrix Upside Down import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int count = 0; int[][] ary = new int[10][10]; for (int i = 0; i < n; i++) { // 뒤집는 횟수를 결정. n번만큼 뒤집는다. for (int a = 0; a < 10; a++) { // x축을 먼저 뒤집는다. if (ary[i][a] == 1) { // i(y축)값을 고정 되어있고, a값(x축)이 변하면서 뒤집는다. ary[i][a] = 0; } else { ary[i][a] = 1; } }.. 2019. 3. 26. [알고리즘 문제] Number Reverse Triangle import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[][] ary = new int[n][n]; int count = 0; int x, y; // 배열 내에서의 x,y좌표 for (int i = 0; i = 0) { // 하나의 군집에서 x값이 --되면서 0이 될때까지 반복 count++; ary[y][.. 2019. 3. 23. [알고리즘 문제] Number Pyramid import java.util.Scanner;import java.util.ArrayList; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int size = sc.nextInt(); int start = sc.nextInt(); ArrayList list = new ArrayList(); for(int i=0;i 2019. 3. 23. 이전 1 ··· 62 63 64 65 66 67 다음