12345   4  /  5  页   跳转

[侃谈天下] 又见变态小学数学题

回复:又见变态小学数学题



#include <iostream>        iostream是啥?我只是学过#include <stdio.h>
using namespace std ;        不懂...这是c++的吧

int main()            主函数,int?
{
int a,b,c,d,e;            定义整形变量的?我在书学回来的
int ans1,ans2;
for(a = 0; a <= 8 ;a = a+2)    下面的都看不懂了..
{
for(b = 0; b <= 9 ;b++)
{
for(c = 0; c <= 9 ;c++)
{
for(d = 0; d <= 9 ;d++)
{
for(e = 0;e <= 9 ;e++)
{
ans1 = a*10000 + b*1000 + c*100 + d*10 + e;
ans2 = e*10000 + d*1000 + c*100 + b*10 + a;
if(ans2 == 4*ans1)
{
cout<<"a=" <<a<<endl;
cout<<"b=" <<b<<endl;
cout<<"c=" <<c<<endl;
cout<<"d=" <<d<<endl;
cout<<"e=" <<e<<endl<<endl;
}
}
}
}
}
}

return 0;
}


不懂得实在太多了
gototop
 

回复:又见变态小学数学题

主函数前写成
void main()
{
}
是中国教材的典型错误
gototop
 

回复:又见变态小学数学题

int是函数的返回值,你还没看到函数这里可以先跳过
gototop
 

回复:又见变态小学数学题

谢谢,以后有不懂的再问
gototop
 

回复 27F 如同天籁 的帖子

打错了,应该是无进位,你就不要难为我了
我是学数学的,数学重要的思考,而不是计算
gototop
 

回复 35F ch_builder 的帖子

我最崇拜学数学的人了
gototop
 

回复 14F BAGGIO·18 的帖子

分析的好清楚呀
gototop
 

回复:又见变态小学数学题

脑筋急转弯
gototop
 

回复:又见变态小学数学题

汗死......
vb......
gototop
 

回复: 又见变态小学数学题



引用:
原帖由 gpsmmmm 于 2009-5-24 18:48:00 发表
汗死......
vb......


更汗,VC
gototop
 
12345   4  /  5  页   跳转
页面顶部
Powered by Discuz!NT