PROGRAMMING50 [C/Baekjoon] 백준 2563번(8-1) : 진법 변환 https://www.acmicpc.net/problem/2745#include #include #include int main() { char input[10000]; //주어진 수 int B; //B진수 int result = 0; scanf("%s %d",input,&B); for(int i = 0; i= '0' && input[i] = 'A' && input[i] [주목할만한 부분]이제 math.h를 include 한다.pow(a,b)는 a^b (a의 b거듭제곱)을 뜻하는 math함수이다. 2025. 1. 23. [C/Baekjoon] 백준 2563번(7-4) : 색종이 https://www.acmicpc.net/problem/2563#include int main() { int num; scanf("%d",&num); int hap = 0; //(0,0)좌표에서부터 시작하는 배열이라고 생각하자! 먼저 차지한 사람이 임자인 방 100X100개이다. //공실일 경우 0, 들어올 경우 1이다. int chk[100][100] = {0}; for(int i = 0; i [주목할만한 부분]이런 식이라면 어떨까?좌표평면을 이런 배열이라고 생각하는 것이다![0][0] ~ [99][99], 총 100x100의 방이 존재한다. 이 문제는 선착순으로 방을 차지하는 문제라고 생각하자. 100x100의 공간에서, 1x1의 네모 한 칸 한 .. 2025. 1. 22. [C/Baekjoon] 백준 25206번(6-8) : 너의 평점은 https://www.acmicpc.net/problem/25206#include #include int main() { double hap = 0.0; //과목합(분자) int count = 0; //학점총합(분모) for(int i = 0; i [주목할만한 부분]배열을 비교할 때에는 strcmp(a,b)를 이용한다. 0이면 a와 b가 같다는 뜻이다.졸시뮬 엑셀 함수와 상당히 유사하다.https://r-pizzza.tistory.com/14 학점 계산기 , 졸업시뮬레이션 구글 스프레드시트 배포https://docs.google.com/spreadsheets/d/1afMKEcyL85-z0a8o_nYl6-no-PMLayM0mmcZSGL2qjk/edit?usp=sharing .. 2025. 1. 19. [C/Baekjoon] 백준 1316번(6-7) : 그룹 단어 체커 https://www.acmicpc.net/problem/1316#include #include int main() { int num; scanf("%d",&num); int countgroup = 0; for(int i = 0; i[주목할만한 부분]순서대로 풀면 된다.또 버킷을 이용한다.알파벳 개수인 26 +1개 크기의 배열을 만들어서 arr[1] = aarr[2] = b~arr[26] = z라고 생각하고 처음에는 0을 담아 둔다.버킷이 1이면서,(if)이미 등장한 문자가 이전 문자와 일치하지 않으면(elseif) 그룹 단어가 아니다. 2025. 1. 19. [C/Baekjoon] 백준 1157번(6-5) : 단어 공부 https://www.acmicpc.net/problem/1157 #include #include int main() { char word[1000001]; int arr[26]; //버킷 scanf("%s",word); int s = strlen(word); for(int i = 0; i= 'a') { //소문자일 때 arr[word[i] - 'a']++; } else { //대문자일 때 arr[word[i]-'A']++; } } int max = 0; char answer; for(int i = 0; imax) { //버킷 값이 더 크다 max.. 2025. 1. 17. [C/Baekjoon] 백준 2444번(6-3) : 별 찍기 - 7 https://www.acmicpc.net/problem/2444 #include int main() { int num; scanf("%d",&num); //커진다! for(int i = 1; i0; j--) { printf(" "); } for(int k = i*2-1; k>0; k--) { printf("*"); } printf("\n"); } //작아진다! for(int i = num-1; i>0; i--) { for(int j = num-i; j>0; j--) { printf(" "); } for(in.. 2025. 1. 15. 이전 1 2 3 4 5 6 7 8 9 다음