프로그래머스

Programmers/programmers Lv.0

[프로그래머스] 피자 나눠 먹기 (1)

//피자 나눠 먹기 (1) //문제 설명 //머쓱이네 피자가게는 피자를 일곱 조각으로 잘라 줍니다. //피자를 나눠먹을 사람의 수 n이 주어질 때, //모든 사람이 피자를 한 조각 이상 먹기 위해 필요한 피자의 수를 return 하는 solution 함수를 완성해보세요. public class Pizza { public static void main(String[] args) { int n = 24; int answer = 0; if( n%7 == 0 ) { answer = n/7; }else { answer = n/7 + 1; } System.out.println(answer); }//main } 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등..

Programmers/programmers Lv.0

[프로그래머스] 나이 출력

public class Solution { public static void main(String[] args) { int age = 0; Solution sl = new Solution(); sl.solution(age); System.out.println(sl.solution(age)); }//main public int solution(int age) { int answer = 0; answer = 2022 - age; return answer; }

Programmers/programmers Lv.0

[프로그래머스] 영어가 싫어요

//영어가 싫어요 //문제 설명 //영어가 싫은 머쓱이는 영어로 표기되어있는 숫자를 수로 바꾸려고 합니다. //문자열 numbers가 매개변수로 주어질 때, numbers를 정수로 바꿔 return 하도록 //solution 함수를 완성해 주세요. public class ihateEnglish { public static void main(String[] args) { String[] number_arr = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" }; String numbers = "onefourzerosixseven"; for (int i = 0; i < number_arr.length; i++) ..

korany
'프로그래머스' 태그의 글 목록