#include<stdio.h>
#include<math.h>
int main()
{
int n;
while(n>=100&&n<=999)
{
if (pow(n/100,n)+pow(n%10,n)+pow(n/10%10,n)==n)
printf("n=%d",n);
}
}
Addition: Online, etc., urgent! ! ! ! !
Welcome Guest.
#include<stdio.h>
#include<math.h>
int main()
{
int n;
while(n>=100&&n<=999)
{
if (pow(n/100,n)+pow(n%10,n)+pow(n/10%10,n)==n)
printf("n=%d",n);
}
}
Addition: Online, etc., urgent! ! ! ! !
+5Votes
First of all, I don’t know what function you want to implement
Second, your program is completely wrong
Your n is not initialized, it is a random number
You The loop does not change the value of n
and in general, the shaping operation does not use pow