y*y
7 楼
He deleted his post because he know he made a mistake.
BUt it seems you still dont understand and self-feeling good.
What I mean is int(x+0.5) gives you x if x is an interger itself.
but 四舍五入 gives you x+1. so int(x+0.5) is a wrong answer. You need
to write if-else.
【在 h**h 的大作中提到】
: take it easy, think about so many non-cs majors changed to
: Computer Science.
: It is always hard to get started.
BUt it seems you still dont understand and self-feeling good.
What I mean is int(x+0.5) gives you x if x is an interger itself.
but 四舍五入 gives you x+1. so int(x+0.5) is a wrong answer. You need
to write if-else.
【在 h**h 的大作中提到】
: take it easy, think about so many non-cs majors changed to
: Computer Science.
: It is always hard to get started.
y*y
8 楼
faint...it seems I made the mistake....anyway,sometimes brain
stalk....:(
【在 y***y 的大作中提到】
: He deleted his post because he know he made a mistake.
: BUt it seems you still dont understand and self-feeling good.
: What I mean is int(x+0.5) gives you x if x is an interger itself.
: but 四舍五入 gives you x+1. so int(x+0.5) is a wrong answer. You need
: to write if-else.
stalk....:(
【在 y***y 的大作中提到】
: He deleted his post because he know he made a mistake.
: BUt it seems you still dont understand and self-feeling good.
: What I mean is int(x+0.5) gives you x if x is an interger itself.
: but 四舍五入 gives you x+1. so int(x+0.5) is a wrong answer. You need
: to write if-else.
b*d
16 楼
Best? How do you evaluate if a program is good or poor?
Do you think such code is in good style?
【在 l*l 的大作中提到】
: you are smart, but the code is too long, even it is sample.
: I write one line and solve it, I guess it is the best code any one can
: get.
: print int(($x+abs($x))/2+0.5)+int(($x-abs($x))/2-0.5);
Do you think such code is in good style?
【在 l*l 的大作中提到】
: you are smart, but the code is too long, even it is sample.
: I write one line and solve it, I guess it is the best code any one can
: get.
: print int(($x+abs($x))/2+0.5)+int(($x-abs($x))/2-0.5);
相关阅读
哪位在UNIX下用过Midnight Commander?help for g77two emacs problems如何在GNUPLOT中使用颜色?how to forward emails?ssh client on Solarisquestion about CVShelp on job running !!Question about chinese input in cxtermAny email client to use under cxterm?我的alia放在script里为什么不工作?linux中有什么超级终端工具吗?怎样打印出grep后的部分内容?How to enable line-number-mode permanently in xemacs?请问哪里能下在UNIX操作的教程?谢谢了!同时运行sshd和rshda question about renaming.anybody debuged MPI programs?怎么把RPM转换成UNIX下的PKG呢?beginner's question: Emacs vs. vi