由买买提看人间百态

topics

全部话题 - 话题: can3
(共0页)
G***G
发帖数: 16778
1
来自主题: Programming版 - 请问4个开关的条件怎么用switch case
四个开关
Can1,Can2, Can3,Can4
1)条件是Can1,Can2,Can3, Can4都是1的时候,执行A
2)条件是这四个有且只有3个是1的时候,
执行B1(对应Can1, can2,can3)
执行B2 (对应Can1,Can2, Can4)
.....
执行B4 (对应Can2, can3,can4)
3)条件是四个中有且只有2个是1的时候
执行C1 (can1, can2)
执行C2 (can1, can3)
...
执行C6 (can3, can4)
4)只有一个是1的时候
执行D1 (can1)
...
执行D4 (can4)
我的问题是,用if else 嵌套好,还是用switch case好?switch case怎么写这个算法?
谢谢!
l*******a
发帖数: 6688
2
来自主题: ebiz版 - 惨了,手上还有8个kindle 4
why can3?
L**P
发帖数: 3792
3
来自主题: Living版 - recessed筒灯接电源一问
可以,我就这么做的,但是你要自己先弄清楚走线
我的原来是这样的,
电源线I--东墙开关--A 线经从东墙网上阁楼---西墙插座上插头,所以这个孔受开关控
制,动这里
同时电源线II--西墙插座下插头,所以这个孔不受开关控制,不动这里
方法是
天花板打四个洞
放四个recessed light的CAN1,2,3,4
CAN 1 == CAN 2 == CAN3 == CAN4连好,黑线接黑线,白线接白线
然后到阁楼,剪断A线, 黑线接黑线,白线接白线,到CAN 4
这样灯就完工了
但是西墙插座上孔没电了,你可以不理,或者买个新的插座,接上就是,利用电源线II供电
给上插头和下插头
如果是阁楼爬不进的,地方不够的,或者是12楼之间的,要买remodel recessed lighting
can,14刀一个,不然可以买new construction lighting can,7刀一个
只要你能找到那里剪断A线,就可以完成
如果有insulation,你要买insulation contact的lighting can
至于什么功率啥的,如果只接4灯,几乎不需要考虑,一般用什么就什么,应该... 阅读全帖
j**4
发帖数: 10425
4
来自主题: NewYork版 - zui4 bei1 can3 de
an olympic math medalist, end up working for paypal IT...
just like any F-2 da4 ma1, got some crappy CS degree and end up working for
paypal...
just sooo sad
m****s
发帖数: 8992
5
来自主题: NewYork版 - zui4 bei1 can3 de
PayPal has C-level executives too....
he could make it.
tough for Da Ma...
j**4
发帖数: 10425
6
来自主题: NewYork版 - zui4 bei1 can3 de
what was his job title when he died?
m****s
发帖数: 8992
7
来自主题: NewYork版 - zui4 bei1 can3 de
if it starts with C at all, it has to be Crap
C_Os don't commit suicide.
a*o
发帖数: 25262
8
来自主题: NewYork版 - zui4 bei1 can3 de
As long as the person doesn't have any complaint, he can be a happy janitor,
too. It's sad because everyone thinks so, and that makes him think that way
too.
Whenever you compare, it only makes u feel sad, because everyone only looks
up, and rarely looks down. But when you look down, you will be a lot happier.

for
j**4
发帖数: 10425
9
来自主题: NewYork版 - zui4 bei1 can3 de
if everyone looks down, then there's no progress in the world

janitor,
way
looks
happier.
a*o
发帖数: 25262
10
来自主题: NewYork版 - zui4 bei1 can3 de
when you look up, you have to prepare to be the loser, and that won't take
your life.
You compete, you loss, and you think that's not the end of the world, OK.
But if you think you compete, you loss, then it ends..
too bad.
Progress in this world is driven by profits..
m*****5
发帖数: 23482
11
来自主题: NewYork版 - zui4 bei1 can3 de
一切都是命,不要不服
人家餐馆大妈还能中彩票,比你一辈子挣得都多
j******3
发帖数: 18319
12
来自主题: NewYork版 - zui4 bei1 can3 de
paypal IT应该非常不错吧。
奥赛金牌的应该做什么算好啊。

for
g*****l
发帖数: 211
13
来自主题: NewYork版 - zui4 bei1 can3 de
sigh
m*******n
发帖数: 5103
14
来自主题: Seattle版 - 巧遇国内土豪
贊博學!!!
田喬仔,can3 giao a4,因土地致富的土財主、暴發戶
s*********t
发帖数: 16647
15
来自主题: paladin版 - 喜欢张丹风的是不是女士多?

kao...must be can3 bu4 ren3 du3 a....fortunately, never watched it
s********g
发帖数: 92
16
来自主题: Programming版 - 请问4个开关的条件怎么用switch case
unsigned char sw=can4<<3 | can3<<2 | can2<<1 | can1;
switch(sw){
case 1:
//operation D1
break;
case 2:
//operation D2
break;
...
case 13:
//operation B2
break;
case 14:
//operation B1
break;
case 15:
//operation A
}
S********a
发帖数: 1163
17
来自主题: _SFparents版 - Save $3 for Day Out with Thomas
o.. thought u bot in Jun, and still havent got it.. 9 can3 leh.
(共0页)