题意:求[a,b]与n互质的个数
思路:容斥原理的运用,提取n的素因子,先算出不与n互素的个数,容斥原理奇加偶减
#include
#include
#include
#include
#define ll long long
using namespace std;
const int MAXN = 70;
ll prime[MAXN];
ll a,b,n;
ll make(l...
分类:
其他好文 时间:
2014-07-22 23:05:55
阅读次数:
315
经常会在项目中用到 int to string
#include
#include
#include
using namespace std;
int main(void)
{
ostringstream num;
num << 123;
string str = num.str();
cout << str << endl;
return 0;
}...
分类:
编程语言 时间:
2014-07-22 23:04:54
阅读次数:
283
提交以后比赛结束了25秒,没交上,不解释其他的。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 0x3fffffff
#include
using namespace std;
int main()
{
int t...
分类:
其他好文 时间:
2014-07-22 23:02:54
阅读次数:
211
#include #include using namespace std; struct
BTNode { int v; // default positive Integer. BTNode *pLeft; BTNode *pRight;
BTNode(int x) : v(x), pLeft(...
分类:
其他好文 时间:
2014-07-22 23:00:54
阅读次数:
294
一,Linq to EF using System;using
System.Runtime.CompilerServices;using System.Linq;using System.Data; namespace
EntityframeworkSQL{ class Program { sta...
分类:
数据库 时间:
2014-07-22 23:00:53
阅读次数:
553
using System;using System.Collections.Generic;using
System.IO;using System.Linq;using System.Text;using
System.Threading.Tasks;namespace 读文件案例{ cla...
分类:
其他好文 时间:
2014-07-22 22:59:55
阅读次数:
241
从文本文件添加到数据库用户表的记录(有两个文件:frmMain.cs SqlHelper.cs
)//FrmMain.cs//作者:Meusing System;using System.Collections.Generic;using
System.ComponentModel;using Sy...
分类:
数据库 时间:
2014-05-01 22:45:21
阅读次数:
667
题目题意:给定a, b, x, y; 求使c, d; 使c:d = x :y; 且c 2
#include 3 #include 4 #include 5 using namespace std; 6 7 long long gcd(long
long a, long long b) 8 {...
分类:
其他好文 时间:
2014-05-01 19:30:04
阅读次数:
372
一。
1.基类的私有成员仅在基类中可见,而在派生类中是不可见的,基类的私有成员可以由派生类继承,但在派生类中不可见
2.使用using声明可以改变成员在派生类中的访问权限。比如,基类中的共有成员在一般情况下被继承为共有成员,但使用using 声明可以将其改为私有成员...
分类:
其他好文 时间:
2014-05-01 18:57:11
阅读次数:
231
#include "iostream"
using namespace std;
//class 关键字 //Circle 是类的名字
class Circle
{
int m_age;//什么都不加 默认为private;
private: //private 修饰的成员变量和成员函数,只能在类的内部使用;
double xiaosi; //私有成员属性,...
分类:
编程语言 时间:
2014-04-30 22:45:39
阅读次数:
313