1.解法一:完全背包#include#includeusing namespace std;#define MAX(a,b) (a>b)?a:bconst int SIZE=500000+16;int dp[SIZE];int bag[7];int nLimit;void ZeroOnePack(i...
分类:
其他好文 时间:
2015-08-05 19:52:09
阅读次数:
120
view类中:
MainView.h
//typedef 这个是重新定义,typeof是求类型
typedef void (^RegisterBlock)(NSString*);
//定义block
@property (nonatomic,strong)
RegisterBlock registerBlock;
MainView.m
有:按钮的触发...
分类:
其他好文 时间:
2015-08-05 18:37:11
阅读次数:
89
有两种方法:
1、通过AppDelegate来判断;
2、在基类中创建NSNotification
- (void)viewDidLoad
{
[super viewDidLoad];
// 注册通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hello)...
分类:
移动开发 时间:
2015-08-05 18:34:25
阅读次数:
132
一. 泛型概念的提出(为什么需要泛型)?
首先,我们看下下面这段简短的代码:
public class GenericTest {
/**
* @param args
*/
public static void main(String[] args) {
List list = new ArrayList();
list.add("qqyumid...
分类:
编程语言 时间:
2015-08-05 18:22:40
阅读次数:
153
1 import java.math.*; 2 import java.util.*; 3 4 public class Main 5 { 6 public static void main(String[] args) 7 { 8 Scanner cin=new...
分类:
编程语言 时间:
2015-08-05 18:17:32
阅读次数:
132
添加一个全局应用程序类Global.asax代码会在访问网站时运行Global.asax代码: 1 void Application_Start(object sender, EventArgs e) 2 { 3 // 在应用程序启动时运行的代码 4 ...
分类:
Web程序 时间:
2015-08-05 18:15:10
阅读次数:
126
方法一WindowProcvoid __fastcall myWindowProc(Messages::TMessage &Message); //增加Classes::TWndMethod OldWindowProc; //增加void __fastcall TForm1::myWindowPro...
分类:
编程语言 时间:
2015-08-05 18:10:54
阅读次数:
224
protected void Btn_Up_Click(object sender, EventArgs e) { // Specify the path on the server to // save the uploaded file to. // String savePath = @...
分类:
Web程序 时间:
2015-08-05 18:10:51
阅读次数:
113
InputStreamReader类可以将InputStream字节流转化成Reader字符流: 1 void inputStreamReader() { 2 // InputStreamReader类可以将InputStream字节流转化成Reader字符流 3 /...
分类:
其他好文 时间:
2015-08-05 17:43:39
阅读次数:
85
//用面向对象多态的思想分别去求圆形和长方形的面积和周长static void Main(string[] args) { Sharp sharp = new Circle(5); double area=sharp.GetArea();...
分类:
其他好文 时间:
2015-08-05 17:43:36
阅读次数:
126