close
標題:

寫一 C 程式求整數 1 ~10000 之間的所有阿姆斯壯數

aa.jpg

 

此文章來自奇摩知識+如有不便請留言告知

發問:

可以幫我解一下這題嗎

最佳解答:

#include int main() { int i, j, num, sum; for(i=1; i<=10000; i++) { // 確認數字為n位數 int n=0; num = i; while(num!=0) { num/=10; n++; } // 計算各個位數的數字n次方加總 num=i; sum=0; while(num!=0) { int temp = 1; for(k=0; k
其他解答:

參考看看他的答案 http://ts777.ccFBEFE3C2E0474026
arrow
arrow

    njtnvdt 發表在 痞客邦 留言(0) 人氣()