目前共有1篇帖子。
【试题】特殊的数字
1樓 巨大八爪鱼 2016-3-3 17:25
#include <stdio.h>

int main()
{
    int num;
    int a, b, c;
    for (num = 100; num <= 999; num++)
    {
        a = num / 100;
        b = num % 100 / 10;
        c = num % 10;
        if (a * a * a + b * b * b + c * c * c == num)
            printf("%d\n", num);
    }
    return 0;
}

回復帖子

內容:
用戶名: 您目前是匿名發表
驗證碼:
 
 
©2010-2025 Arslanbar [手機版] [桌面版]
除非另有聲明,本站採用創用CC姓名標示-相同方式分享 3.0 Unported許可協議進行許可。