题意:将一个数拆成两个合数的和, 输出这两个数!(这道题做的真是TMD水啊)开始的时候不知道composite numbers是啥意思,看了3遍才看懂....看懂之后又想用素数筛选法来做,后来决定单个判断一个数是否为素数的方法来写,结果写错了两次,快疯掉了简直.... 1 #include 2 #i...
分类:
其他好文 时间:
2014-09-29 15:30:11
阅读次数:
228
题意:一共有n种灯泡,不同种类的灯泡必须用不同种电源,但同一种灯泡可以用同一种电源。每种灯泡有四个参数:电压值V、电源费用K、每个灯泡的费用C、所需该种灯泡的数量L为了省钱,可以用电压高的灯泡来代替电压低的灯泡。输出最小费用。分析:每种电源的灯泡要么不换要么全换,因为只换部分的话,两种类型的电源都要...
分类:
其他好文 时间:
2014-09-29 04:26:56
阅读次数:
274
The Observer PatternThe Observer is a design pattern where an object (known as a subject) maintains a list of objects depending on it (observers), aut...
分类:
编程语言 时间:
2014-09-29 03:15:49
阅读次数:
287
The Singleton PatternThe Singleton pattern is thus known because it restricts instantiation of a class to a single object. Classically, the Singleton ...
分类:
编程语言 时间:
2014-09-29 02:54:37
阅读次数:
360
The Module PatternModulesModules are an integral piece of any robust application's architecture and typically help in keeping the units of code for a ...
分类:
编程语言 时间:
2014-09-28 23:04:55
阅读次数:
275
In classical object-oriented programming languages, a constructor is a special method used to initialize a newly created object once memory has been a...
分类:
编程语言 时间:
2014-09-28 22:56:05
阅读次数:
213
GoF (Gang of Four,四人组, 《Design Patterns: Elements of Reusable Object-Oriented Software》/《设计模式》一书的作者:Erich Gamma、Richard Helm、Ralph Johnson、John Vlissi...
分类:
Web程序 时间:
2014-09-28 19:19:05
阅读次数:
275
/**
?*?@Title:?Aggregate.java
?*?@Package?com.wangbiao.design
?*?@Description:?TODO?
?*?@author?wangbiao???
?*?@date?2014-9-20?下午05:02:00?
?*?@version?V1.0
?*/
package?c...
分类:
编程语言 时间:
2014-09-28 17:16:14
阅读次数:
198
/**
?*?
?*/
package?com.wangbiao.design.composite;
import?java.util.ArrayList;
import?java.util.List;
/**
?*?@Title:?Component.java
?*?@Package?com.wangbiao.design.composite
?*?@De...
分类:
编程语言 时间:
2014-09-28 13:45:03
阅读次数:
217
参考资料http://erlang.shiningray.cn/otp-design-principles/index.html标准 Erlang/OTP 行为有:gen_server用于实现 C/S 结构中的服务端。gen_fsm用于实现有限状态机。gen_event用于实现事件处理功能。supe...
分类:
其他好文 时间:
2014-09-27 15:11:49
阅读次数:
214