#includeusing namespace std;#define Nu 5int main(){ int a[Nu]={1,2,3,-1,4}; cout=0) { b=a[j%Nu]; if(j=b) ...
分类:
编程语言 时间:
2015-04-16 13:50:30
阅读次数:
148
#include
using namespace std;
#include//标准c++不带.h,说明来自c语言
//static_cast,const_cast,reinterpret_cast,dynamic_cast强制类型转换
//const_cast用于临时去掉const、volatile限制
int main()
{
//int n=3.21;
int m=static_cast...
分类:
编程语言 时间:
2015-04-16 12:31:50
阅读次数:
158
#include
using namespace std;
class a
{
public:
virtual void kk();//{}//虚函数是有函数体的
};
class P :virtual public a{
public:
virtual void kk(){cout<<"pppppp";}
};
class M :virtual public a{
public:
...
分类:
其他好文 时间:
2015-04-16 12:29:11
阅读次数:
113
1 #include 2 #include 3 using namespace std; 4 5 6 int main() 7 { 8 string str("some thing"); 9 for(auto &c:str)10 if(!isspace(c)...
分类:
其他好文 时间:
2015-04-16 12:19:40
阅读次数:
91
描述:给出一个单词,在单词中插入若干字符使其为回文串,求回文串的个数(|s|#include#include#includeusing namespace std;#define maxn 410#define mod 10007typedef int ll;struct marix{ int...
分类:
其他好文 时间:
2015-04-16 12:18:58
阅读次数:
219
#include #include using namespace std;typedef struct _ShoolGirl { string name;} ShoolGirl;/* 公共接口 */class GiveGift { virtual void GiveDolls() = ...
分类:
其他好文 时间:
2015-04-16 12:11:35
阅读次数:
110
两种方法:1. 安装Service,然后将VS附加到该Service进行调试。2.修改Program.cs文件。 1 namespace MyProject.Service 2 { 3 static class Program 4 { 5 /// 6 ...
找给定s集合里面word全部是同一个字符的,这样的word有几个,如果数量#include#include#includeusing namespace std;int main(void){ int t; string a; cin>>t; while(t--) { ...
分类:
其他好文 时间:
2015-04-16 12:04:20
阅读次数:
167
题目链接:Codeforces 492E Vanya and Field
通过拓展欧几里得算法求出每个位置在移动过程中,在x为0时,y的位置。统计相应y坐标最多的即为答案。
#include
#include
#include
using namespace std;
const int maxn = 1e6 + 5;
const int maxm = 1e5 + 5;
typedef...
分类:
其他好文 时间:
2015-04-16 10:21:14
阅读次数:
119
#include
using namespace std;
class A
{
public:
A()
{
cout<<"this is construction"<<endl;
}
virtual ~A()
{
cout<<"this is destruction"<<endl;
}
};
A fun()
{
A a;
return a;
}
int main()
{
...
分类:
其他好文 时间:
2015-04-16 10:18:30
阅读次数:
125