自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 资源 (1)
  • 问答 (1)
  • 收藏
  • 关注

原创 如何利用一条简单语句判断一个整数是否为2的整数次幂

在写代码的过程中可能会遇到判断一个整数是否为2的整数次幂的问题,除了枚举的方法,还可以利用二进制的知识进行简单快速判断。2的整数次幂用二进制表示只存在一个1和n个0,因此,我们利用位运算&判断一个整数a与a-1的&是否为0即可。具体代码如下。代码非常简洁。#include<bits/stdc++.h>using namespace std;type...

2019-03-20 11:27:32 519

原创 CF 938A WordCorrection

A. Word CorrectionVictor tries to write his own text editor, with word correction included. However, the rules of word correction are really strange.Victor thinks that if a word contains two consecuti...

2018-02-17 22:41:37 893

原创 CF 939A Love Triangle

A. Love TriangleAs you could know there are no male planes nor female planes. However, each plane on Earth likes some other plane. There are n planes on Earth, numbered from 1 to n, and the plane with...

2018-02-17 22:31:23 348

原创 CF Text Volume

Text Volume题目:You are given a text of single-space separated words, consisting of small and capital Latin letters.Volume of the word is number of capital letters in the word. Volume of the text is max...

2018-02-17 11:05:39 407

原创 CF463 A题Palindromic Supersequence

Palindromic Supersequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a string A. Find a string B, where B is a palindrome and A ...

2018-02-16 00:51:22 421

原创 write a String class by c++(study for c++)

class-Stringwrite a String class by c++自己定义一个字符串类String,使该类实现如下要求:String a=”Hello”;//重载=String b=a,c;//拷贝构造函数 c=b;//重载=String d=”world”; d+=a;重载+=b=a+d;//重载+bool f=a&gt;d;//重载+String e=a.touppe...

2018-02-14 13:20:40 240

原创 基本单链表操作

#include#include#define N 10typedef struct sl{    int s;    struct sl *next;}ss;ss *creat(int  *s){    int i=1;     ss *p,*q,*h;     h=p=(ss*)malloc(sizeof(ss));     p->s=s[0];

2017-09-03 09:26:50 236

windows编程中vc6.0编写的服务器通信小例子

用vc6.0编写的windows网络通信小例子,供学习参考使用.先运行server端再运行Client端。

2019-03-20

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

TA关注的人

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