C# 알고리즘 코딩(프로그래머스)
프로그래머스 C# 아이스 아메리카노(몫과 나머지, 파이썬, 자바)
라이프앤타임
2023. 6. 18. 09:37
using System;
public class Solution {
public int[] solution(int money) {
int[] answer = new int[2];
answer[0] = money / 5500;
answer[1] = money % 5500; //남는 돈= 나머지
return answer;
}
}
파이썬
////
def solution(money):
answer = [money // 5500, money % 5500]
return answer
자바
class Solution {
public int[] solution(int money) {
return new int[] { money / 5500, money % 5500 };
}
}