Problem Description
输入一个正整数N,求出N^3的各位数字的立方和。
Input
输入N的值。N<=1024
Output
问题描述中所要求的数值。
Sample Input
3
Sample Output
351
Hint
Source
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,a,b=0,s;
scanf("%d",&n);
s=n*n*n;
while(s>0)
{
a=s%10;
b=b+a*a*a;
s=s/10;
}
printf("%d",b);
return 0;
}
快乐的一天从学习开始😊😊😊🤣😛