首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

两道面试解决思路

2012-03-02 
两道面试Acartraveled462milesperthankfulofgasonlineonthehighwayand336milesperthankfulofgasonlineinth

两道面试
A   car   traveled   462   miles   per   thankful   of   gasonline   on   the   highway   and   336   miles   per   thankful   of   gasonline   in   the   city.If   the   car   traveled   6   fewer   miles   per   gallon   in   the   city   than   on   the   highway,how   many   miles   per   gallon   did   the   car   travel   in   the   city?
                                                                  A.14         B.16         C.21         D.22         E27
 
Kim   bought   a   tatal   of     $2.65   worth   of   postage   stamps   in   for   denominations.   If   the   bought   an   equal   number   of   5-cent   stamps,what   is   the   least   number   of   1-cent   stamps   she   could   have   bought?
                                                                  A.5             B.10           C.15         D.20         E.25

[解决办法]
1、实际上就是求一个方程 :462/336=(x+6)/x => 462x==336(x+6)
main()
{
for( i=1;i <=27;i++)
{
while(462*i==336*(i+6))
printf( "%d ",i);
}
}
....................................

------------------------------------
答案是16

热点排行