Basic practice special numbers

Problem Description
  153 is a very special number that is equal to the sum of the cubes of its digits, ie 153=1*1*1+5*5*5+3*3*3. Program to find all three-digit decimal numbers that satisfy this condition.
output format
  Output the three-digit decimal numbers that satisfy the condition in ascending order, each number occupies a line.
#include <stdio.h>  
#include<math.h>  
intmain()  
{  
    int t[3], i;  
    for(i=100; i<1000; i++)  
    {  
        t[0] = i%10;  
        t[1] = i/10%10;  
        t[2] = i/100;  
        if(i == pow(t[1], 3)+pow(t[0], 3)+pow(t[2], 3))  
            printf("%d\n", i);  
    }  
    return 0;   
}   

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326303433&siteId=291194637