2019년 4월 13일 토요일

# 마지막 자릿수 가져오기.

1
2
3
4
5
6
7
8
9
int GetLastDigit(unsigned int number) {
 int lastDigit = 0;
 unsigned int portion = number;
 while (portion > 0) {
  portion /= 10;
  lastDigit = number % 10;
 }
 return lastDigit;
}

댓글 없음:

댓글 쓰기