Topic: 来报道了,顺便带了个小程序,请大虾看看 |
Print this page |
1.来报道了,顺便带了个小程序,请大虾看看 | Copy to clipboard |
Posted by: zhoujianghost Posted on: 2009-01-22 15:42 我是一名JAVA初学者是自学,经朋友推荐买了本《JAVA编程基础、应用与实例》一个韩国人 徐明浩 写 武传海 翻译成中文讲得很详细。好像和论坛钟所说的那本白色封面的书差不多。封面也是白色的。好了直接上程序 package lianxi; public class Shere { /** * @param args */ public static void main(String[] args) { String a="国语:90",b="英语:80",c="数学:70"; int a1=90; int a2=80; int a3=70; int b1=a1+a2+a3; int c1=b1/3; System.out.println(a+b+c); System.out.println("总分:"+b1); System.out.println("平均分"+c1); System.out.println((c1<70)&&(c1>70)?"普通":"优秀"); /* 80<70 80>70 true :false false true false 优秀*/ } } 结果应该有个批注:优秀 可小弟不知道该加到哪里,请大虾指教。 在这先谢过了 |
2.Re:来报道了,顺便带了个小程序,请大虾看看 [Re: zhoujianghost] | Copy to clipboard |
Posted by: 九佰 Posted on: 2009-01-23 17:28 (c1<70)&&(c1>70) 的结果始终是 false c1<70 并且 c1>70 ,满足这个条件的c1不存在。 平均成绩小于70 为普通,大于等于70为优秀 System.out.println(c1<70?"普通":"优秀"); |
3.Re:来报道了,顺便带了个小程序,请大虾看看 [Re: zhoujianghost] | Copy to clipboard |
Posted by: xiaowenhuman Posted on: 2009-04-11 20:24 你上传的程序的运行结果如图 有个优秀啊! |
4.Re:来报道了,顺便带了个小程序,请大虾看看 [Re: zhoujianghost] | Copy to clipboard |
Posted by: wuanfo Posted on: 2009-04-13 10:07 晕,这种问题就不用提了吧 |
5.Re:来报道了,顺便带了个小程序,请大虾看看 [Re: zhoujianghost] | Copy to clipboard |
Posted by: JiafanZhou Posted on: 2009-04-20 17:39 (c1<70)&&(c1>70) is an obvious mistake. It is like telling others "I want a c1 less than 70 and meanwhile c1 must be greater than 70" Jiafan |
6.Re:来报道了,顺便带了个小程序,请大虾看看 [Re: zhoujianghost] | Copy to clipboard |
Posted by: zhrllx001 Posted on: 2009-04-21 02:29 你的调教判断语句永远为FALSE 因为逻辑与,要两个真才是真。 这种判断应该if~else 语句分开判断的 |
7.Re:来报道了,顺便带了个小程序,请大虾看看 [Re: zhoujianghost] | Copy to clipboard |
Posted by: yhl27 Posted on: 2009-04-21 22:43 顶! |
8.Re:来报道了,顺便带了个小程序,请大虾看看 [Re: xiaowenhuman] | Copy to clipboard |
Posted by: careson919 Posted on: 2009-07-06 10:55 xiaowenhuman wrote: 大哥,不要害人家啊,他那个程序?:的条件是错的 不管分数是不是大于80,都会有个优秀!!! |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |