特点 单例模式的特点: 1、仅仅能有一个实例; 2、必须自己创建自己的一个实例; 3、必须给全部其它对象提供这一实例。饿汉式单例模式 也称为预先载入法,实现方式例如以下:[java]view plaincopyclassSingle{privateSingle()(Syustem.out.print...
#include#include#include #define N 30main(){int a,b,k,i,n;float c,d;srand(time(NULL));do{printf("\n请输入数字类型(1.整数 2.小数) -1为退出程序: ");scanf("%d",&n);switc...
一些细节老是记不住,索性转到自己的博客了转自:http://blog.csdn.net/kingstar158/article/details/6859379在看C++编程思想中,每个练习基本都是使用ofstream,ifstream,fstream,以前粗略知道其用法和含义,在看了几位大牛的博文后...
转至:http://www.cnblogs.com/openeim/p/3921835.html机器学习十大算法之一:EM算法。能评得上十大之一,让人听起来觉得挺NB的。什么是NB啊,我们一般说某个人很NB,是因为他能解决一些别人解决不了的问题。神为什么是神,因为神能做很多人做不了的事。那么EM算法...
https://leetcode.com/problems/valid-parentheses/Valid ParenthesesGiven a string containing just the characters'(',')','{','}','['and']', determine if ...
import reimport urllibdef getHtml(url):page=urllib.urlopen(url)html=page.read()return htmldef getpic(html):s=r'src="(.*?\.jpg)" pic_ext'piclist=re.fin...
Isomorphic Strings Given two stringssandt, determine if they are isomorphic. Two strings are isomorphic if the characters inscan be replaced to gett.A...
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, ...
import sysfrom PyQt4 import QtGui , QtCoreclass LIN(QtGui.QMainWindow):def _init_(self):QtGui.QMainWindoW._init_(self)self.setWindowTitle('lin')self.r...