自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(23)
  • 收藏
  • 关注

转载 空指针的那些事

空指针的那些事

2017-11-21 10:20:16 214

转载 编码的那些事

转载链接: https://www.cnblogs.com/signheart/p/c3b1000186199e89d4e02c33f39ed418.html 结论: 当保存为ANSI文件时, 若是某字符不在字符集中,会边编辑软件替换为 ? ,  也就是说会改变文件内容 ANSI (American National Standards Institute,美国国家标准学

2017-11-20 21:29:33 324

原创 hdoj 1241 dfs1

#include #include #include using namespace std; int m,n; char a[110][100]; bool vis[110][110]; void  dfs(int , int ); int main() {     int ans=0;     while(~scanf("%d%d",&m,&n),m&&n)     {

2017-03-10 08:22:26 173

原创 hdoj 2717

/*  BFS  */ #include #include #include #include using namespace std; int vis[100005]; queue q; int bfs(int x, int y) {     while(!q.empty())     q.pop();     q.push(x);     v

2017-02-22 22:25:39 220

原创 hdoj 1213

/*  并查集模板 1.初始化 2.join函数 3._find函数 4.在find函数中缩短路径 5.计数根节点 */ #include #include using namespace std; int pre[1005]; int _find(int x) {     int r=x;     while(r!=pre[r])      

2017-02-22 18:37:55 234

原创 hdoj 2035

/* 1.快速幂: 1 int poww(int a,int b){ 2 int ans=1,base=a; 3 while(b!=0){ 4 if(b&1!=0) 5   ans*=base; 6 base*=base; 7 b>>=1; 8   } 9 return ans; 10 }

2017-02-09 20:30:46 279

原创 hdoj 2034

/* 1.数组初始化为0; */ #include #include using namespace std; int main() {     int n1,n2,a[110],b[110];     int i,j;     while(cin>>n1>>n2,n1||n2)     {         int flag=0;         int c

2017-02-09 19:21:39 245

原创 hdoj 2033

/* 1.类似大数问题,对进位的处理; */ #include using namespace std; int main() {     int n;     int h1,h2,m1,m2,s1,s2;     cin>>n;     while(n--)     {         int carry1=0,carry2=0;         cin>

2017-02-09 18:23:22 174

原创 hdoj 2031

/* 1.利用字符串把数字转换成对应字符 */ #include using namespace std; int main () {     char st[20]="0123456789ABCDEF";     int i,n,m,r[20];     while(cin>>n>>m)     {         if(n         {      

2017-02-09 17:56:24 154

原创 hdoj 2011

#include #include using namespace std; int main() {     int n,m,i;     cin>>n;     while(n--)     {         cin>>m;         double s=0;         for(i=0;i             i%2==0?s=s+1.0/(i+

2017-02-08 12:37:54 207

原创 hdoj 1040

/* algorithm中有sort;  */ #include #include using namespace std; int main() {     int a[1001];     int n,m,i;     cin>>n;     while(n--)     {         cin>>m;         for(i=0;i    

2017-02-08 12:19:21 232

原创 hdoj 1096

/* 1.注意格式与换行      2.这种情况一般会用到for循环的i变量进行判断 */ #include using namespace std; int main() {     int i,n,m,s,t;     cin>>n;     for(i=0;i     {         s=0;         cin>>m;         wh

2017-02-08 11:49:06 178

原创 hdoj 2022

/* 1.行与列注意别混淆;     2.每组数据x,y都需要初始化;     3.把矩阵看成数据流; */ #include #include using namespace std; int main() {     int n,m,x=1,y=1,max,t;     while(cin>>m>>n)     {         for(int i=0

2017-02-02 22:11:44 215

原创 hdoj 2020

/* 1.swap包含在 */ #include #include using namespace std; int main () {     int n,a[110];     while(cin>>n,n)     {         for(int i=0;i             cin>>a[i];         for(int i=0

2017-02-02 21:03:10 195

原创 hdoj 2019

/*1.cout #include using namespace std; int main() {     int a[110];     int n,m;     while(cin>>n>>m,n!=0||m!=0)     {         int flag=1;         for(int i=0;i         {          

2017-02-02 19:54:07 243

原创 hdoj 2018

/* 1.此类由前推后的数列题,一般可以找到递推公式;     2.当对数组角标不好理解时,可以舍弃a[0]不用; */ #include using namespace std; int main() {     int n,a[60];     while(cin>>n,n!=0)     {         if(n         int i;//i为

2017-02-02 19:26:03 211

原创 hdoj 2017

/* 1.头文件cctype(c++)  / ctype(c) 函数名称 返回值 isalnum() 如果参数是字母数字,即字母或数字,该函数返回true isalpha() 如果参数是字母,该函数返回真 isblank() 如果参数是空格或水平制表符,该函数返回true iscntrl() 如果参数是控制字符,该函数返回true

2017-02-02 18:55:28 368

原创 hdoj 2017

/* 1.cout输出空格用字符串     2.seat记录位置 */ #include #include using namespace std; int main () {     int seat,t,n,i,a[100];     while(scanf("%d",&n),n!=0)     {         for(i=0;i             c

2017-02-02 18:05:19 148

原创 hdoj 1001

/* 1.注意输出格式 */ #include int main () {     int s=0,i,n;     while(~scanf("%d",&n))     {         s=0;         for(i=0;i             s=s+i+1;         printf("%d\n\n",s);     }     return 0;

2017-02-02 10:58:52 177

原创 hdoj 2089

/* 1.数组达百万级时会导致栈溢出,window栈分配1M; 所以定义静态数组,使数组分配在堆上;     2.hdoj : time limit  exceeded 1000ms; */      #include int regist[1000001]; int main() {     int n,m;     int i;     for(i=0;i

2017-01-31 22:51:23 315

原创 hdoj 2086

/*1.对数列的数学处理*/ #include int main() {     int n,i;     double c[3000],a0,an1;     while(~scanf("%d",&n))     {         double a1,s=0;         scanf("%lf%lf",&a0,&an1);         for(i=0;i

2017-01-31 21:29:27 295

原创 hdoj 2080

/* 1.define PI acos(-1.0)     2.角度与弧度 */ #include #include #define PI acos(-1.0) int main() {     int n,i;     double x[2],y[2],angle;     double cosi;     scanf("%d",&n);     for(i=0;

2017-01-31 20:47:58 198

原创 hdoj 2036

/* 1.重载函数调用不明确 fabs(double);     2.面积公式     3.逗号表达式     4.模的运用   */ #include #include int main () {     int i,x[100],y[100];     int n;     while(~scanf("%d",&n)&&(n!=0))     {      

2017-01-31 19:39:07 224

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除