728x90 반응형 배열 돌리기2 미세먼지 안녕! www.acmicpc.net/problem/17144 17144번: 미세먼지 안녕! 미세먼지를 제거하기 위해 구사과는 공기청정기를 설치하려고 한다. 공기청정기의 성능을 테스트하기 위해 구사과는 집을 크기가 R×C인 격자판으로 나타냈고, 1×1 크기의 칸으로 나눴다. 구사 www.acmicpc.net #include #include #include #include #define NMSIZE 50 int N, M, T;//y축, x축, 시간 int map[NMSIZE][NMSIZE];//초기 입력으로 주어지는 배열 int a1y, a1x, a2y, a2x;//공기청정기 위치 int dy[] = { 0,-1,0,1 };//이동할 방향 배열 int dx[] = { 1,0,-1,0 }; int ret;//결과값 .. 2020. 10. 9. 1225 암호 생성기 #include #include #include using namespace std; int n; int arr[9]; int retIdx; struct Screat { Screat() { int t; while (cin >> t) { init(); for (int i = 0; i < 8; i++) { scanf("%d",&arr[i]); } arrCircle(); printf("#%d ", t); int cnt = 0; for (int i = 0; i < 8; i++) { printf("%d ", arr[retIdx++]); if (retIdx == 8)retIdx = 0; } printf("\n"); } } void init() { memset(arr, 0, sizeof(arr)); retIdx = .. 2020. 2. 27. 이전 1 다음 728x90 반응형