Home > Back-end >  Help: all single digits in the output from 1 to 1000 cubic is equal to the number itself
Help: all single digits in the output from 1 to 1000 cubic is equal to the number itself

Time:06-06

#include
Int main ()
{
Int a=0, b=0, c=0;
While (a<=9)
{
C + +;
If (c * * c=c + 10=100 * a * b + c)
Printf (" % d \ n ", 100 * a + 10 * b + c);
If (c=9)
{
C=0;
B++;

If (b=9)
{
C=0;
B=0;
+;
}
}
}
Turn right once I this how

CodePudding user response:

 # include & lt; Stdio. H> 

Int main ()
{
Int a=0, b=0, c=0;
While (a<=9)
{
C + +;
If (c * * c=c + 10=100 * a * b + c)
Printf (" % d \ n ", 100 * a + 10 * b + c);
//if (c=9)
If (c==9)
{
C=0;
B++;

//if (b=9)
If (b==9)
{
C=0;
B=0;
+;
}
}
}
}

For your reference ~

CodePudding user response:

# include "stdio.h"
Int main ()
{
Int I, a;
for(i=1; i<=1000; I++)
{
A=I % 10;
If (a * a * a==I)
Printf (" % d \ n ", I);
}
return 0;
}

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related