암스트롱의 세 자리 숫자 확인
153 = 1*1*1 + 5*5*5 + 3*3*3 1634 = 1*1*1*1 + 6*6*6*6* + 3*3*3*3 + 4*4*4*4
JavaScript
xxxxxxxxxx
let sum = 0;
const number = prompt('Enter a three-digit positive integer: ');
let temp = number;
while (temp > 0) {
let remainder = temp % 10;
sum += remainder * remainder * remainder;
temp = parseInt(temp / 10);
}
if (sum == number) {
console.log(`${number} is an Armstrong number`);
}
else {
console.log(`${number} is not an Armstrong number.`);
}
Enter a three-digit positive integer: 153 153 is an Armstrong number.
Linux - anc-api-tools 를 설치하는 방법
Linux - curvedns 를 설치하는 방법
Linux - zenmap 를 설치하는 방법
Python - 숫자가 양수, 음수 또는 0인지 확인
C - 정수의 자릿수 계산
C - 동적 메모리 할당을 사용하여 가장 큰 수 찾기
Python - Excel(XLSX) 파일 쓰기
Kotlin - 숫자 뒤집기
C++ - 숫자가 소수인지 여부 확인
Kotlin - 숫자의 계승 구하기
JavaScript - 문자열이 특정 문자로 시작하고 끝나는지 확인
C++ - 윤년 확인
Linux - zstd 를 설치하는 방법
C++ - 몫과 나머지 찾기
Python - 버블 정렬
Java - 숫자 뒤집기
Linux - xbitmaps 를 설치하는 방법
Kotlin - 숫자를 n 소수점 이하 자릿수로 반올림
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month