所謂 Armstrong number 指的是一個 n 位數的整數,它的所有位數的 n 次方和恰好等於自己。
如;1634 = 14 + 64 + 34+ 44
請依題目需求在一定範圍內找出該範圍內的所有 armstrong numbers.
輸入說明 :
輸入包含兩個數字n, m(n<m, n>0, m<=1000000),代表所有尋找 armstrong number 的範圍
輸出說明 :
將所有範圍內的 armstrong number 依序由小到大輸出,如果沒有找到請輸出 none.
範例輸入 :
100 999 10 99
範例輸出 :
153 370 371 407 none
提示 :
出處 :
Jiangsir
http://zerojudge.tw/ShowProblem?problemid=a040
#include<stdio.h> int num,num1,num2,tot,test,test1,test2,change,n,cod; void main() }
|
留言列表