'프로그래밍/Ruby' 카테고리의 글 목록 — 매일을 꿈틀대는 법

프로그래밍/Ruby

프로그래밍/Ruby

[루비 Ruby/알고리즘] 백준 2443번 : 별 찍기 - 6

//GitHub https://github.com/vellimole0621 vellimole0621 - Overview vellimole0621 has 4 repositories available. Follow their code on GitHub. github.com 백준 2443번 : 별 찍기 - 6 ( 문제 - https://www.acmicpc.net/problem/2443) 문제 설명 : 첫째 줄에 N이 주어지고. 첫째 줄에는 별 2*N-1개 둘째 줄에는 2*N-3개 ... N번째 줄에는 별 1개를 찍는 문제이다. 단 별은 가운데 기준 대칭이어야 한다. 풀이 : 정수 N 입력 받음 > 필요한 정수만큼 줄 반복 (반복문) > 우선 필요한 공백 수 담을 변수 / 필요한 별 수 담을 변수 생성 > 각..

프로그래밍/Ruby

[루비 Ruby/알고리즘] 백준 10039번 : 평균 점수

//GitHub https://github.com/vellimole0621 vellimole0621 - Overview vellimole0621 has 4 repositories available. Follow their code on GitHub. github.com 백준 10039번 : 평균 점수 ( 문제 - https://www.acmicpc.net/problem/10039) 문제 설명 : 5명의 점수를 모아 평균 점수를 구하라. 단 40점을 넘지 못 했을 경우 40점으로 계산한다. 풀이 : 전체 점수 담을 변수 생성 > 5번 점수 받는 반복문 생성 > 각 점수 입력 시 40점 넘는 지 조건문으로 체크해서 못 넘는 경우 40점으로 변수에 값을 더하고. 넘는 경우 그 점수로 값을 더함 > 변수를 5로..

프로그래밍/Ruby

[루비 Ruby/알고리즘] 백준 2440번 : 별 찍기 - 3

//GitHub https://github.com/vellimole0621 vellimole0621 - Overview vellimole0621 has 4 repositories available. Follow their code on GitHub. github.com 백준 2440번 : 별 찍기 - 3 ( 문제 - https://www.acmicpc.net/problem/2440) 문제 설명 : 정수 하나를 입력 받아, 별이 그 수 만큼 찍히고 그 다음 문장은 그 수 -1 만큼 찍히게 되어 별이 하나 찍힐 때 까지 반복하는 반복문을 만들어라 풀이 : 정수 받기 > 이중 반복문 코드 #백준 2440번 별 찍기 - 3 # 별 찍을 줄 수 받기 n = gets.to_i for i in 1..n do for ..

프로그래밍/Ruby

[루비 Ruby/알고리즘] 백준 2338번 : 긴자리 계산

//GitHub https://github.com/vellimole0621 vellimole0621 - Overview vellimole0621 has 4 repositories available. Follow their code on GitHub. github.com 백준 2338번 : 긴자리 계산 ( 문제 - https://www.acmicpc.net/problem/2338) 문제 설명 : 두 정수 A, B를 입력 받음 > 각각 A+B, A-B, A*B의 결과를 출력함 풀이 : X 코드 #백준 2338번 긴자리 계산 # 두 개의 정수의 입력을 받음 A = gets.to_i B = gets.to_i # 각 + - * 결과값 출력 puts "#{A+B}" puts "#{A-B}" puts "#{A*B}"

프로그래밍/Ruby

[루비 Ruby/알고리즘] 백준 2557번 : Hello World

//GitHub https://github.com/vellimole0621 vellimole0621 - Overview vellimole0621 has 4 repositories available. Follow their code on GitHub. github.com 백준 2557번 : Hello World ( 문제 - https://www.acmicpc.net/problem/2557 ) 문제 설명 : Hellow World! 를 출력하자. 풀이 : X 코드 #백준 2557번 Hello World puts("Hello World!") 피드백 : X

호놀률루
'프로그래밍/Ruby' 카테고리의 글 목록