|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 继续前进1234 于 2019-10-11 09:09 编辑
不知道这样写有什么问题,结果是错的
#include <stdio.h>
int main ( )
{
int a, b, c, d;
d= a*100+b*10+c;
for (a = 1;a < 10;a++)
{
for (b=0;b<10;b++)
{
for(c=0;c<10;c++)
{
if(d==a*a*a+b*b*b+c*c*c)
printf ("%d\t",d);
}
}
}
return 0;
}
- #include <stdio.h>
- int main ( )
- {
- int a, b, c, d;
-
- for (a = 1;a < 10;a++)
- {
- for (b=0;b<10;b++)
- {
- for(c=0;c<10;c++)
- {
- d= a*100+b*10+c;
- if(d==a*a*a+b*b*b+c*c*c)
- printf ("%d\t",d);
- }
- }
-
- }
-
- return 0;
- }
- /*
- e:\>cl ct1.c
- 用于 80x86 的 Microsoft (R) 32 位 C/C++ 优化编译器 16.00.30319.01 版
- 版权所有(C) Microsoft Corporation。保留所有权利。
- ct1.c
- Microsoft (R) Incremental Linker Version 10.00.30319.01
- Copyright (C) Microsoft Corporation. All rights reserved.
- /out:ct1.exe
- ct1.obj
- e:\>ct1
- 153 370 371 407
- */
复制代码
|
|