1. 문제https://www.acmicpc.net/problem/2566 2. 풀이#include int main(void) { int digits[10][10]; int max = 0; int maxRow, maxCol; for(int i = 0; i max){ max = digits[i][j]; maxRow = i; maxCol = j; } } } printf("%d\n%d %d", max, maxRow+1, maxCol+1);}
1. forEach와 map의 차이forEach는 새로운 배열을 return 하지 않기 때문에 Virtual Dom에서 변경 사항이 없다고 판단하고 리랜더링하지 않는다.따라서 특정 결과값을 얻기 위해서는 map을 사용해야 한다. * li로 전달해줄 때는 자식 요소를 찾을 수 있는 고유의 key 값이 필요하다.Food 컴포넌트에 key 속성 전달! 1) FoodContainer.jsimport React from 'react';import Food from './Food';const FoodContainer = () => { const foods = [ { id : 1, name : "샐러드", }, { id : 2, name : "치킨", }, ..
1. 문제https://www.acmicpc.net/problem/2941 2. 풀이#include int main(void){ char str[101]; int count = 0; scanf("%s", str); for (int i = 0; str[i] != '\0'; i++){ count ++; if(str[i] == '=') { if (str[i-1] == 'c' || str[i-1] == 's') { count--; } if (str[i-1] == 'z'){ if (str[i-2] == 'd') { count -= 2; } else { count--; } ..
1. 문제https://www.acmicpc.net/problem/1157 2. 풀이#include int main(void) { char str[1000000]; int count[26] = { 0, }; // 알파벳 회수가 저장될 배열 char result = '?'; // 가장 많이 사용된 알파벳 int maxCount = 0; // 가장 많이 사용된 알파벳의 등장 횟수 int flag = 0; // 가장 많이 사용된 알파벳이 여러 개 존재하는 지 scanf("%s", str); // 알파벳 빈도 계산 for(int i = 0; str[i] != '\0'; i++){ int index = (str[i] >= 'a') ? str[i] - 'a' ..
1. 문제https://www.acmicpc.net/problem/3003 2. 풀이#include int main(void) { // int king, queen, rook, bishop, knight, pawn; int correct[6] = { 1, 1, 2, 2, 2, 8 }; int current[6] = { 0, }; int result[6] = { 0, }; for(int i = 0; i
- Total
- Today
- Yesterday
- 칸토어 집합
- 붙임성 좋은 총총이
- 베라의 패션
- python
- 25304
- 백준
- 브라우저
- SWLIfeCycle
- 4779
- 데이터추상화
- 26069
- 배수
- 약수
- 직사각형
- 삼각형과세변
- 알고리즘
- 개발계발
- C언어
- SW생명주기
- C99
- 배수와약수
- 점근적표기
- 과제안내신분
- 약수들의합
- 25314
- 27323
- 파이썬
- 브라우저뜻
- 다음소수
- 피보나치수5
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |