码迷,mamicode.com
首页 >  
搜索关键字:count    ( 18169个结果
C语言:每瓶汽水1元,两个空瓶可以置换一瓶汽水,现在有20元,最多能喝多少瓶汽水。
#include<stdio.h> #defineMAX20 intmain() { intmoney=MAX; intcount=MAX; while(1) { if(money%2!=0) { count=count+money-1; break; } else { money=money/2; count+=money; } } printf("%d\n",count); return0; }
分类:编程语言   时间:2015-11-04 07:10:48    阅读次数:169
筛法求1000000以内素数个数---时间复杂度为o(n)
这样做倒是挺简单的,怎么容易怎么做#include#include#define maxn 1000000int isprime[maxn+10];int prime[maxn/10];int count;int n;int main(){ while(scanf("%d",&n)!=EOF)...
分类:其他好文   时间:2015-11-04 00:22:49    阅读次数:194
LINQ中的陷阱--TakeWhile&SkipWhile
在用TakeWhile,SkipWhile设置陷阱之前,我们先来看一看他们的兄弟Take和Skip:public static IEnumerable Take(IEnumerable source, int count)public static IEnumerable Skip(IEnumera...
分类:其他好文   时间:2015-11-03 22:36:58    阅读次数:177
统计一个文件中出现字符'a'的次数
# -*- coding: utf-8 -*-#python 27#xiaodeng#统计一个文件中出现字符'a'的次数#http://www.cnblogs.com/hongten/p/hongten_python_count.htmlimport osnumber=0def getNumber(...
分类:其他好文   时间:2015-11-03 12:30:58    阅读次数:129
[列表包含]Count and say
一、题目The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off a...
分类:其他好文   时间:2015-11-03 12:02:49    阅读次数:188
where/group by/ having
1、查询每个部门的总人数select deptId,COUNT(*) as sum from bas_dept group by deptId;select返回集字段中,这些字段要么就要包含在Group By语句的后面(deptId),作为分组的依据;要么就要被包含在聚合函数中(count(*)聚合...
分类:其他好文   时间:2015-11-03 10:30:05    阅读次数:135
[LeetCode]54. Count Primes统计素数
Description:Count the number of prime numbers less than a non-negative number, n.Credits:Special thanks to @mithmatt for adding this problem and creat...
分类:其他好文   时间:2015-11-03 10:28:12    阅读次数:269
bzoj1036: [ZJOI2008]树的统计Count 树链剖分+线段树
入门题+ 熟悉代码/************************************************************** Problem: 1036 User: 96655 Language: C++ Result: Accepted Time:...
分类:其他好文   时间:2015-11-02 23:03:30    阅读次数:300
WPF 接收exe传的值
原文:WPF 接收exe传的值 一,首先重载APP protected override void OnStartup(StartupEventArgs e) { if (e.Args != null && e.Args.Count() > 0) { this.Properties["str1".....
分类:Windows程序   时间:2015-11-02 15:21:08    阅读次数:308
UVA 11536 Smallest Sub-Array
题意: x[i]=(x[i-3]+x[i-2]+x[i-1])%m+1,求一段x的最短的连续子序列,使得这个子序列包含正整数【1,k】。分析: 扫描一遍即可,用一个队列记录下【1,k】区间内的数的位置,再用一个变量count维护【1,k】内不重复数的个数。当count等于k时说明当前序列已经满足.....
分类:其他好文   时间:2015-11-02 11:43:36    阅读次数:169
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!