1. 프로그래머스 기출 문제

This commit is contained in:
2025-04-08 13:51:41 +09:00
parent 6cfea47a0f
commit 80521c093a
8 changed files with 161 additions and 0 deletions

21
과제2폴더/2-2.txt Normal file
View File

@@ -0,0 +1,21 @@
#include <string>
#include <vector>
using namespace std;
int solution(vector<vector<int>> board, int k) {
int answer = 0;
for (int i=0; i<board.size(); i++)
{
for (int j=0; j<board[i].size(); j++)
{
if (i+j <= k)
{
answer += board[i][j];
}
}
}
return answer;
}