本文介绍了功能除以三的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 不使用/,%和*运算符。写一个函数将 数除以3. itoa()函数可用 Without using /,% and * operators. write a function to divide anumber by 3.itoa() function is available 推荐答案 做自己的功课。 - 问候, Hallvard Do your own homework. --Regards,Hallvard 谁需要itoa()?假设整数除法和只有正输入, 它是微不足道的,虽然不是很精确有效,或者必然很快,但是只需要重复减法。 b $ b - Don Bruder - da **** @ sonic.net - 如果你的来自:地址不在我的白名单上, 或邮件的主题不包含确切的文字PopperAndShadow 某处,发送给此的任何邮件地址将进入垃圾,没有我的 ,知道它到了。对不起...< http://www.sonic.net/~dakiddfor more info Who needs itoa()? Assuming integer division and only positive inputs,it''s trivial, although not precisely efficient, or necessarily fast, tosimply do repetitive subtraction. --Don Bruder - da****@sonic.net - If your "From:" address isn''t on my whitelist,or the subject of the message doesn''t contain the exact text "PopperAndShadow"somewhere, any message sent to this address will go in the garbage without myever knowing it arrived. Sorry... <http://www.sonic.net/~dakiddfor more info 做自己的功课。 Do your own homework. 嘿!我只是有一个好主意......让我们看看这个是否让他感到恐慌: int DivBy3(int x) { int q; for(q = 0; x> 2; x- = 3,q ++); 返回q; } (ROT-13) Bs pbhefr,guvf yvggyr" dhvpx-a-qvegl" jvyy bayl jbex sbe cbfvgvir vachgf,naq vg''f tbvat gb或(pbzcnengviryl fcrnxvat)fybjre guna gur frpbaq pbzvat sbe ovt vachgf,ohg vg''yy qb gur wbo。 Naq vg fubhyq或 " nqinaprq" rabhtu gung gur grnpure jvyy fync uvz sbe boivbhf purngvat vs ur npghnyyl hfrf vg - n pynff ng gur yriry guvf bar frrzf gb or onfrq ba uvf" qb zl ubzrjbex sbe zr erdhrfgf jba''g unir gur svefg pyhr nobhg gur " snapl" gevpx bs penzzvat vg nyy vagb n sbe()ybbc(vs gurl''ir rira yrnearq nobhg gurz ng nyy lrg)naq jvgu uvf qvfcynlrq yriry bs vtabenapr,V unir ab qbhog ur''yy或hanoyr gb rira ORTVA rkcynvavat ubj vg jbexf jura gur grnpure nfxf uvz。 Ubcrshyyl rafhevat ng yrnfg na S ba guvf nffvtazrag sbe purngvat。 - Don Bruder - da **** @ sonic.net - 如果你的来自:地址不在我的白名单上, 或邮件的主题不包含确切的文字PopperAndShadow 某处,发送给此的任何邮件地址将进入垃圾,没有我的 ,知道它到了。对不起...< http://www.sonic.net/~dakidd了解更多信息 Hey! I just had a great idea... Let''s see if this one gets him dinged: int DivBy3(int x){int q; for (q=0;x>2;x-=3,q++);return q;} (ROT-13)Bs pbhefr, guvf yvggyr "dhvpx-a-qvegl" jvyy bayl jbex sbe cbfvgvirvachgf, naq vg''f tbvat gb or (pbzcnengviryl fcrnxvat) fybjre guna gurfrpbaq pbzvat sbe ovt vachgf, ohg vg''yy qb gur wbo. Naq vg fubhyq or"nqinaprq" rabhtu gung gur grnpure jvyy fync uvz sbe boivbhf purngvat vsur npghnyyl hfrf vg - n pynff ng gur yriry guvf bar frrzf gb or onfrq bauvf "qb zl ubzrjbex sbe zr" erdhrfgf jba''g unir gur svefg pyhr nobhg gur"snapl" gevpx bs penzzvat vg nyy vagb n sbe () ybbc (vs gurl''ir rirayrnearq nobhg gurz ng nyy lrg) naq jvgu uvf qvfcynlrq yriry bsvtabenapr, V unir ab qbhog ur''yy or hanoyr gb rira ORTVA rkcynvavat ubjvg jbexf jura gur grnpure nfxf uvz. Ubcrshyyl rafhevat ng yrnfg na S baguvf nffvtazrag sbe purngvat. --Don Bruder - da****@sonic.net - If your "From:" address isn''t on my whitelist,or the subject of the message doesn''t contain the exact text "PopperAndShadow"somewhere, any message sent to this address will go in the garbage without myever knowing it arrived. Sorry... <http://www.sonic.net/~dakiddfor more info 这篇关于功能除以三的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-27 11:09