题意:给一个数n,返回小于n的素数个数。思路: 1 class Solution { 2 public: 3 int countPrimes(int n) { 4 bool* isPrime =new bool[n] ; 5 6 memset...
分类:
其他好文 时间:
2015-06-26 22:19:55
阅读次数:
123
Given an unsorted array of n integers which can contain integers from 1 to n. Some elements can be repeated multiple times and some other elements can...
分类:
其他好文 时间:
2015-06-26 19:41:52
阅读次数:
127
题目:给你一些字符,问能组成几个MARGARITA。
分析:简单题。直接统计计算即可。
说明:最近状态有点不稳定╮(╯▽╰)╭。
#include
#include
#include
#include
#include
#include
using namespace std;
int main()
{
int n,count[6];
char buf[606];
w...
分类:
其他好文 时间:
2015-06-26 12:51:09
阅读次数:
107
目前总结的语句,在查看数据的连接情况很有用 ,写完程序一边测试代码一边查看数据库连接的释放情况有助于分析优化出一个健壮的系统程序来。1.Sql代码1.select count(*) from v$process--当前的数据库连接数select count(*) from v$process;2.S...
分类:
数据库 时间:
2015-06-26 10:51:35
阅读次数:
219
和属性类似,方法也分实例方法和类方法。
在class中定义的全部是实例方法,实例方法第一个参数 self 是实例本身。
要在class中定义类方法,需要这么写:
class Person(object):
count = 0
@classmethod
def how_many(cls):
return cls.count
def __i...
分类:
编程语言 时间:
2015-06-26 09:22:45
阅读次数:
151
8.3 使用C语言访问MySQL数据
4.处理返回的数据
MySQL返回两种类型的数据
1.从表中提取的信息,也就是列数据
2.关于数据的数据,即所谓的元数据(metadata),例如列名和类型.
mysql_field_count函数提供了一些关于查询结果的基本信息,它接受连接对象,并返回结果集中的字段(列)数目:
unsigned int mysql_field_count(...
分类:
数据库 时间:
2015-06-26 09:22:38
阅读次数:
123
1、子查询更新update kapage_news b set sharecount=(select COUNT(*) FROM kasharing a where a.srcid=b.newsid);View Code
分类:
数据库 时间:
2015-06-26 08:02:18
阅读次数:
135
题目一:public class testClockwiseOutput { //顺时针打印一个矩阵 @Test public void test(){ int[][] num = new int[100][100]; int n = 4; int count =1; for(int i=0;i=....
分类:
编程语言 时间:
2015-06-26 00:14:04
阅读次数:
127
if (noID != null && noID.Count > 0){ q = q.Where(a =>! noID.Contains(a.NewsID) );}
分类:
其他好文 时间:
2015-06-25 22:57:35
阅读次数:
142
#198 House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them...
分类:
其他好文 时间:
2015-06-25 21:16:15
阅读次数:
110