又是一个鸡兔同笼的问题 |
答題得分者是:ikk
|
zhouying82
高階會員 發表:150 回覆:272 積分:189 註冊:2004-03-16 發送簡訊給我 |
题目如下,鸡兔同笼共24只脚,请问有多少只鸡和多少只兔 写出可能的组合
<!-- google_ad_client = "pub-8722551381340391"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel = "1224894520"; google_color_border = "EEF2F7"; google_color_bg = "EEF2F7"; google_color_link = "FF9900"; google_color_text = "5884C8"; google_color_url = "000000"; //-->window.google_render_ad();<iframe width="" scrolling="no" height="" frameborder="0" allowtransparency="true" hspace="0" vspace="0" marginheight="0" marginwidth="0" src="http://googleads.g.doubleclick.net/pagead/ads?client=undefined&dt=1228790767460&lmt=1228790766&format=undefinedxundefined&output=html&correlator=1228790767460&url=http://delphi.ktop.com.tw/webmaster.php?action=t_medit&cid=168&fid=1499&tid=96383&ea=0&ref=http://delphi.ktop.com.tw/board.php?cid=168&fid=1499&tid=96383&frm=0&ga_vid=1461894405.1223346758&ga_sid=1228789482&ga_hid=1826560233&ga_fc=true&flash=10.0.12&u_h=1050&u_w=1680&u_ah=1020&u_aw=1680&u_cd=32&u_tz=480&u_his=13&u_nplug=15&u_nmime=76&dtd=569" name="google_ads_frame"></iframe>window.google_render_ad(); 我的代码如下,请大大帮我看看,是哪里出了问题。 [code cpp] #include int main() { int cook,rabbit; for(cook=1;cook<=20;cook )//放鸡的话,最多10只 { for(rabbit=1;rabbit<=20;rabbit )//放兔子的话,最多5只 if((rabbit cook==24))break; printf("cook = %d,rabbit = %d\n",cook/2,rabbit/4); } getchar(); } [/code]
------
断断续续的学了几年,还是一个初学者,永远支持Delphi ! 編輯記錄
taishyang 重新編輯於 2008-12-09 10:27:23, 註解 歸類成[問題]‧
|
ikk
尊榮會員 發表:4 回覆:413 積分:768 註冊:2003-06-30 發送簡訊給我 |
[code cpp] int main() { int cook,rabbit; for(cook=2;cook<=20;cook =2)//放鸡的话,最多10只 { for(rabbit=4;rabbit<=20;rabbit =4)//放兔子的话,最多5只 if((rabbit cook==24)) printf("cook = %d,rabbit = %d\n",cook/2,rabbit/4); } getchar(); } [/code] ===================引 用 zhouying82 文 章=================== 题目如下,鸡兔同笼共24只脚,请问有多少只鸡和多少只兔 写出可能的组合 <!-- google_ad_client = "pub-8722551381340391"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel = "1224894520"; google_color_border = "EEF2F7"; google_color_bg = "EEF2F7"; google_color_link = "FF9900"; google_color_text = "5884C8"; google_color_url = "000000"; //-->window.google_render_ad();<iframe height="" frameborder="0" width="" scrolling="no" allowtransparency="true" hspace="0" vspace="0" marginheight="0" marginwidth="0" src="http://googleads.g.doubleclick.net/pagead/ads?client=undefined&dt=1228798094461&lmt=1228798094&format=undefinedxundefined&output=html&correlator=1228798094461&url=http://delphi.ktop.com.tw/webmaster.php?action=t_medit&cid=168&fid=1499&tid=96383&rid=200184&ea=0&ref=http://delphi.ktop.com.tw/board.php?cid=168&fid=1499&tid=96383&frm=0&ga_vid=1020394786.1228729978&ga_sid=1228797581&ga_hid=170215245&ga_fc=true&flash=10.0.12&u_h=1024&u_w=1280&u_ah=1024&u_aw=1280&u_cd=32&u_tz=480&u_his=30&u_java=true&u_nplug=12&u_nmime=58&dtd=3" name="google_ads_frame"></iframe>window.google_render_ad();<iframe height="" frameborder="0" width="" scrolling="no" name="google_ads_frame" src="http://googleads.g.doubleclick.net/pagead/ads?client=undefined&dt=1228798037514&lmt=1228798036&format=undefinedxundefined&output=html&correlator=1228798037514&url=http://delphi.ktop.com.tw/webmaster.php?action=t_medit&cid=168&fid=1499&tid=96383&rid=200184&ea=0&ref=http://delphi.ktop.com.tw/board.php?cid=168&fid=1499&tid=96383&frm=0&ga_vid=1020394786.1228729978&ga_sid=1228797581&ga_hid=1399978679&ga_fc=true&flash=10.0.12&u_h=1024&u_w=1280&u_ah=1024&u_aw=1280&u_cd=32&u_tz=480&u_his=28&u_java=true&u_nplug=12&u_nmime=58&dtd=233" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true"></iframe>window.google_render_ad();<iframe height="" frameborder="0" width="" scrolling="no" allowtransparency="true" hspace="0" vspace="0" marginheight="0" marginwidth="0" src="http://googleads.g.doubleclick.net/pagead/ads?client=undefined&dt=1228797914298&lmt=1228797914&format=undefinedxundefined&output=html&correlator=1228797914298&url=http://delphi.ktop.com.tw/webmaster.php?action=t_medit&cid=168&fid=1499&tid=96383&rid=200184&ea=0&ref=http://delphi.ktop.com.tw/board.php?cid=168&fid=1499&tid=96383&frm=0&ga_vid=1020394786.1228729978&ga_sid=1228797581&ga_hid=1902560810&ga_fc=true&flash=10.0.12&u_h=1024&u_w=1280&u_ah=1024&u_aw=1280&u_cd=32&u_tz=480&u_his=26&u_java=true&u_nplug=12&u_nmime=58&dtd=5" name="google_ads_frame"></iframe>window.google_render_ad();<iframe height="" frameborder="0" width="" scrolling="no" name="google_ads_frame" src="http://googleads.g.doubleclick.net/pagead/ads?client=undefined&dt=1228797865213&lmt=1228797865&format=undefinedxundefined&output=html&correlator=1228797865213&url=http://delphi.ktop.com.tw/webmaster.php?action=t_medit&cid=168&fid=1499&tid=96383&rid=200184&eid=30143001&ea=0&ref=http://delphi.ktop.com.tw/board.php?cid=168&fid=1499&tid=96383&frm=0&ga_vid=1020394786.1228729978&ga_sid=1228797581&ga_hid=1484435900&ga_fc=true&flash=10.0.12&u_h=1024&u_w=1280&u_ah=1024&u_aw=1280&u_cd=32&u_tz=480&u_his=24&u_java=true&u_nplug=12&u_nmime=58&dtd=5" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true"></iframe>window.google_render_ad();<iframe height="60" frameborder="0" width="468" scrolling="no" name="google_ads_frame" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1324131235014043&dt=1228797743795&lmt=1228797743&prev_fmts=468x60_as&format=468x60&output=html&correlator=1228797743773&url=http://delphi.ktop.com.tw/post.php?action=usereply&cid=168&fid=1499&tid=96383&iid=20876&ea=0&ref=http://delphi.ktop.com.tw/userlogin.php&frm=0&ga_vid=1020394786.1228729978&ga_sid=1228797581&ga_hid=1942426249&ga_fc=true&flash=10.0.12&u_h=1024&u_w=1280&u_ah=1024&u_aw=1280&u_cd=32&u_tz=480&u_his=20&u_java=true&u_nplug=12&u_nmime=58&dtd=2" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true"></iframe>window.google_render_ad();<iframe height="" frameborder="0" width="" scrolling="no" allowtransparency="true" hspace="0" vspace="0" marginheight="0" marginwidth="0" src="http://googleads.g.doubleclick.net/pagead/ads?client=undefined&dt=1228790767460&lmt=1228790766&format=undefinedxundefined&output=html&correlator=1228790767460&url=http://delphi.ktop.com.tw/webmaster.php?action=t_medit&cid=168&fid=1499&tid=96383&ea=0&ref=http://delphi.ktop.com.tw/board.php?cid=168&fid=1499&tid=96383&frm=0&ga_vid=1461894405.1223346758&ga_sid=1228789482&ga_hid=1826560233&ga_fc=true&flash=10.0.12&u_h=1050&u_w=1680&u_ah=1020&u_aw=1680&u_cd=32&u_tz=480&u_his=13&u_nplug=15&u_nmime=76&dtd=569" name="google_ads_frame"></iframe>window.google_render_ad(); 我的代码如下,请大大帮我看看,是哪里出了问题。 [code cpp] #include int main() { int cook,rabbit; for(cook=1;cook<=20;cook )//放鸡的话,最多10只 { for(rabbit=1;rabbit<=20;rabbit )//放兔子的话,最多5只 if((rabbit cook==24))break; printf("cook = %d,rabbit = %d\n",cook/2,rabbit/4); } getchar(); } [/code]
------
FPGA驗證, FPGA開發平台, http://smims.com |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |