#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
这样做倒是挺简单的,怎么容易怎么做#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
在用TakeWhile,SkipWhile设置陷阱之前,我们先来看一看他们的兄弟Take和Skip:public static IEnumerable Take(IEnumerable source, int count)public static IEnumerable Skip(IEnumera...
分类:
其他好文 时间:
2015-11-03 22:36:58
阅读次数:
177
# -*- 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
一、题目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
1、查询每个部门的总人数select deptId,COUNT(*) as sum from bas_dept group by deptId;select返回集字段中,这些字段要么就要包含在Group By语句的后面(deptId),作为分组的依据;要么就要被包含在聚合函数中(count(*)聚合...
分类:
其他好文 时间:
2015-11-03 10:30:05
阅读次数:
135
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
入门题+ 熟悉代码/************************************************************** Problem: 1036 User: 96655 Language: C++ Result: Accepted Time:...
分类:
其他好文 时间:
2015-11-02 23:03:30
阅读次数:
300
原文:WPF 接收exe传的值 一,首先重载APP protected override void OnStartup(StartupEventArgs e) { if (e.Args != null && e.Args.Count() > 0) { this.Properties["str1".....
题意: 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