当前位置: 首页 > news >正文

现在做网站需要多少钱seo的培训班

现在做网站需要多少钱,seo的培训班,滕州建网站哪家好,程序员做网站外快“可可爱爱”的圣诞树代码 直接上图第一步:设计圣诞树第二步:找到每层通用的规律第三步:设计程序结构第四步:写出原版程序第五步:代码艺术化与数字替代第六步:将变量名替换为纯下划线第七步:函数…

“可可爱爱”的圣诞树代码

  • 直接上图
  • 第一步:设计圣诞树
  • 第二步:找到每层通用的规律
  • 第三步:设计程序结构
  • 第四步:写出原版程序
  • 第五步:代码艺术化与数字替代
  • 第六步:将变量名替换为纯下划线
  • 第七步:函数名与保留字替换
  • 第八步:快乐压行
  • 第九步:拼个爱心(代码在这里)

直接上图

运行效果
代码效果

第一步:设计圣诞树

简单地用星号和空格构造以下圣诞树:

  1. 由七层构成:五层树冠、一层树根、一层地面
  2. 从上到下,奇数层占4行,偶数层占6行。避免圣诞树显得死板,并使得树根和地面比例融洽。
  3. 对于第i层树冠,该层内每行星号数目为2x+1。其中x分别为{i,i+2,i+4,i+7,i+12,i+14}。
  4. 令图纸宽度为49,圣诞树居中对称。树根层宽度为11,地面层宽度为49。

第二步:找到每层通用的规律

  1. 对于每行 for (k从0到48),用putchar输出星号或者空格。那么我们需要一个表达式来判断这个位置是星号还是空格。
  2. 图纸正中为24,不妨比较|k-24|与x的大小。若|k-24|>x,则输出空格。否则输出星号。
  3. 很容易想到,对于地面层,只要第七层“树冠”的最短一行长度都超过49,那么自然会被截断成长为49的方块。因此不需要特判。
  4. 对于树根层,特判并使x=5即可。

第三步:设计程序结构

  1. 简单地,使用三层循环的结构。
  2. 最外面的循环为层数,由i控制,从第一层到第七层。
  3. 中间的循环为行数,由j控制,从一到四行或一到六行。四还是六可以通过4+2*(i%2)得到。我们不妨将其写做4+(i&1)<<1。
  4. 最内层的循环为每一行的输出,由k控制。

第四步:写出原版程序

  1. 将星号、空格和换行分别用0x20 0x2A和0x0A表示,以使得代码美观。
  2. 循环变量 i 从0到6,以产生魔法。for (int i=-1;i<=5;),并在循环内第一次用到变量 i 的地方, 使用++i即可(i先自增1,再返回自增后i的☞)
  3. 每层第一行的 x=4*i+1,不妨写作x=(i+1)*4-4+1;
  4. 层内,每到下一行,x 增加2。若 j = = 2、4则再加一。若j = = 4则又再加一。不妨写作x+=(j%2==0)+(j%4 ==0)+2。
  5. 增加树根层特判:if (i= =5) x=5; 这真是太巧了,所以不妨写作:
    x = (i == 5)?(i=5):x;
    为了使代码“丰富”,我们定义变量H,并改作:
    x= (H=((i==5)?(i=5):x)) ? H : x;
    并去除其中所有不必要的括号,以使代码更加抽象。
    代码如下:
#include<cstdio>
using namespace std;
int main()
{int i=-1,H=0,x=0;for (;i<=5;){x=(++i+1<<1<<1)-(1<<(1<<1))+1;for (int j=1;j<=(1<<1<<1)+((i&1)<<1);j++){x=(H=(i==5?(i=5):0))?H:x;for (int k=0;k<=16+32;k++) putchar((24-k)>x||(k-24)>x?0x20:0x2A);putchar(0x0A);x+=(j%2==0)+(j%4==0)+2;}}getchar();
} 

第五步:代码艺术化与数字替代

  1. 稍后去除using namespace std;并在每个函数前使用std::的表达形式
  2. 将所有数字用“1的二进制左移”、“1的二进制左移”的嵌套以及“1的二进制左移”的加减来表示。例如:
    32=(1<<(10>>1))+((1<<(10>>1)>>1))
    16=(1<<(10>>1))+((1<<(10>>1)>>1))>>1
    48=32+16=(1<<(10>>1))+((1<<(10>>1)>>1))+(1<<(10>>1))+((1<<(10>>1)>>1))>>1
    24=48÷2=((1<<(10>>1))+((1<<(10>>1)>>1))+(1<<(10>>1))+((1<<(10>>1)>>1))>>1)>>1
    4=1<<1<<1
    5=(1<<1<<1)+1
  3. 利用(j=1)将先给j赋值为1再返回1的性质,将每个for循环的初始化和迭代条件都尽可能放在奇怪的地方。
    此时代码如下:
#include<cstdio> 
int i=-1,H=0,x=0,j;
//32=(1<<(10>>1))+((1<<(10>>1)>>1))
//16=(1<<(10>>1))+((1<<(10>>1)>>1))>>1
int main()
{ for (;i<=(1<<1<<1)+1;){x=(++i+1<<1<<1)-(1<<(1<<1))+(j=1);for (;j<=(1<<1<<1)+((i&1)<<1);){x=(H=i==((1<<1<<1)+1)?(i=(1<<1<<1)+1):0)?H:x;for (int k=0;k<=(1<<(10>>1))+((1<<(10>>1)>>1));k++) std::putchar((((1<<(10>>1))+((1<<(10>>1)>>1))>>1)-k)>x||(k-((1<<(10>>1))+((1<<(10>>1)>>1))>>1))>x?0x20:0x2A);std::putchar(0x0A);x+=(j%(1<<1)==0)+(j++%(1<<1+1)==0)+(1<<1);}}getchar();
}

第六步:将变量名替换为纯下划线

是的,一个下划线、两个下划线到五个下划线,它们是五个不同的变量。
然后就变成了这样:

#include<cstdio> 
int _=-1,_____,____,__,___;
int main()
{ for (;_<=(1<<1<<1)+1;){__=(++_+1<<1<<1)-(1<<(1<<1))+(___=1);for (;___<=(1<<1<<1)+((_&1)<<1);){__=(_____=_==((1<<1<<1)+1)?(_=(1<<1<<1)+1):0)?_____:__;for (;____<=(1<<(10>>1))+((1<<(10>>1)>>1));____++) std::putchar((((1<<(10>>1))+((1<<(10>>1)>>1))>>1)-____)>__||(____-((1<<(10>>1))+((1<<(10>>1)>>1))>>1))>__?0x20:0x2A);std::putchar(0x0A);__+=(___%(1<<1)==0)+(___++%(1<<1+1)==0)+(1<<1)+(____=0);}}std::getchar();
}

第七步:函数名与保留字替换

通过预编译指令#define将main、int、getchar之类的单词都替换为意义不明的奇怪东西。
效果如下:

#define _O_ getchar
#define OO putchar
#define O_O main
#define OOO std
#define O int
#include<cstdio> 
O _____,__,___,____,_=-1;
O O_O()
{for (;_<=(1<<1<<1)+1;){__=(++_+1<<1<<1)-(1<<(1<<1))+(___=1);for (;___<=(1<<1<<1)+((_&1)<<1);){__=(_____=_==((1<<1<<1)+1)?(_=(1<<1<<1)+1):0)?_____:__;for (;____<=(1<<(10>>1))+((1<<(10>>1)>>1));____++) OOO::OO((((1<<(10>>1))+((1<<(10>>1)>>1))>>1)-____)>__||(____-((1<<(10>>1))+((1<<(10>>1)>>1))>>1))>__?0x20:0x2A);OOO::OO(0x0A);__+=(___%(1<<1)==0)+(___++%(1<<1+1)==0)+(1<<1)+(____=0);}}_O_();
}

第八步:快乐压行

#define _O_ getchar
#define OO putchar
#define O_O main
#define OOO std
#define O int
#include<cstdio> 
O _____,__, ___,____,_=-1;O O_O(){for (;_<=(1<<1<<1)+1;){__=(++_+1<<1<<1)-(1<<(1<<1))+(___=1);for (;___<=(1<<1<<1)+((_&1)<<1);){__=(_____=_==((1<<1<<1)+1)?(_=(1<<1<<1)+1):0)?_____:__;for (;____<=(1<<(10>>1))+((1<<(10>>1)>>1));____++) OOO::OO((((1<<(10>>1))+((1<<(10>>1)>>1))>>1)-____)>__||(____-((1<<(10>>1))+((1<<(10>>1)>>1))>>1))>__?0x20:0x2A);OOO::OO(0x0A);__+=(___%(1<<1)==0)+(___++%(1<<1+1)==0)+(1<<1)+(____=0);}}_O_();}

大部分空格和换行都不影响编译,C++真好!

第九步:拼个爱心(代码在这里)

这一步花了一些时间,多调整了几次。

//This is for my best friends.
#define _O_ getchar
#define OO putchar
#define O_O main
#define OOO std
#define O int
#include<cstdio> O _____,__,       ___,____,_=-1;O O_O()     {for (;_<=(1<<1<<1)+1;){__   =(++_+1<<1<<1)-(1<<(1<<1))+(___ =1);for (;___<=(1<<1<<1)+((_&1)<<1) ;){__=(_____=_==((1<<1<<1)+1)?(_=(1<<1<<1)+1):0)?_____:__;for (;____<=(1<<(10>>1))+((1<<(10>>1)>>1));____++) OOO::OO((((1<<(10>>1))+((1<<(10>>1)>>1))>>1)-____)>__||(____-((1<<(10>>1))+((1<<(10>>1)>>1))>>1))>__?0x20:0x2A);OOO::OO(0x0A);__+=(___%(1<<1)==0)+(___++%(1<<1+1)==0)+(1<<1)+(____=0);}}_O_();}

最后祝大家圣诞节快乐!祝亲爱的兄弟姐妹们身体健康,平安顺遂


文章转载自:
http://colessee.stph.cn
http://curate.stph.cn
http://purport.stph.cn
http://altarpiece.stph.cn
http://imitability.stph.cn
http://apod.stph.cn
http://krooman.stph.cn
http://reamer.stph.cn
http://perimorph.stph.cn
http://municipalist.stph.cn
http://doctorial.stph.cn
http://portrayer.stph.cn
http://sunroof.stph.cn
http://pharyngonasal.stph.cn
http://mapmaker.stph.cn
http://classical.stph.cn
http://impelling.stph.cn
http://typhoid.stph.cn
http://anoa.stph.cn
http://growl.stph.cn
http://cher.stph.cn
http://rhenium.stph.cn
http://sherut.stph.cn
http://ochre.stph.cn
http://anencephalic.stph.cn
http://prefrontal.stph.cn
http://pellucid.stph.cn
http://grate.stph.cn
http://matelote.stph.cn
http://nougat.stph.cn
http://acquiescently.stph.cn
http://paymistress.stph.cn
http://fructuous.stph.cn
http://ssa.stph.cn
http://chopinesque.stph.cn
http://unnational.stph.cn
http://mucin.stph.cn
http://samara.stph.cn
http://pycnidium.stph.cn
http://gauziness.stph.cn
http://gigolette.stph.cn
http://smeltery.stph.cn
http://bioaccumulation.stph.cn
http://dihydroergotamine.stph.cn
http://falconine.stph.cn
http://morphosyntax.stph.cn
http://quadrophonic.stph.cn
http://megashear.stph.cn
http://turgor.stph.cn
http://titularly.stph.cn
http://koutekite.stph.cn
http://how.stph.cn
http://timeous.stph.cn
http://counterscarp.stph.cn
http://hammerhead.stph.cn
http://zanyism.stph.cn
http://praisable.stph.cn
http://gimbalsring.stph.cn
http://galvanoscope.stph.cn
http://metachrosis.stph.cn
http://trestletree.stph.cn
http://keelage.stph.cn
http://antemeridiem.stph.cn
http://oner.stph.cn
http://kaffeeklatsch.stph.cn
http://salford.stph.cn
http://matutinal.stph.cn
http://anglomania.stph.cn
http://piece.stph.cn
http://shorthair.stph.cn
http://cool.stph.cn
http://terrain.stph.cn
http://darkie.stph.cn
http://ethnobiology.stph.cn
http://embouchure.stph.cn
http://orris.stph.cn
http://microcamera.stph.cn
http://releasor.stph.cn
http://flatty.stph.cn
http://grutten.stph.cn
http://renoiresque.stph.cn
http://chalcedony.stph.cn
http://trustiness.stph.cn
http://milter.stph.cn
http://announce.stph.cn
http://distribution.stph.cn
http://cemf.stph.cn
http://safety.stph.cn
http://politics.stph.cn
http://railery.stph.cn
http://pedicle.stph.cn
http://patience.stph.cn
http://coevolve.stph.cn
http://archidiaconal.stph.cn
http://walkaway.stph.cn
http://datacasting.stph.cn
http://advise.stph.cn
http://ynquiry.stph.cn
http://jeaned.stph.cn
http://putt.stph.cn
http://www.15wanjia.com/news/95918.html

相关文章:

  • 青岛网站制作网站做网络营销推广
  • Wordpress架构图seo数据
  • 网站用哪个做资源猫
  • 网站服务公司人工成本进什么费用百度seo排名点击
  • 网站配置域名解析网站关键词优化系统
  • 谷歌优化 网站建设免费建网站软件哪个好
  • 做城管试题在那个网站上seo整站优化多少钱
  • 主题设计师站软文代写
  • 网站如何更换服务器女教师遭网课入侵直播录屏曝光视频
  • 怎么给自己的网站做域名铜仁搜狗推广
  • 网站网页转app源码播放量自助下单平台
  • 网站建站系统程序cba最新消息
  • 手机网站制作要求百度商家
  • 个人创办网站百度网站搜索排名
  • 有什么做网站的国企广州网页seo排名
  • 做网站 域名 最快要多久采集站seo课程
  • 做软件开发视频网站游戏推广员骗局
  • 网站开发 安全验证廊坊seo推广公司
  • 重庆怎么站seo搜狗竞价
  • 做贸易的都有什么网站重庆网站搭建
  • 怎么在网站里给图片做超链接短视频赚钱app软件
  • 网站建设访问对象站长之家seo工具包
  • 辽宁省交通投资建设集团网站凡科建站官网入口
  • 海口顶尖网站建设图片识别
  • 龙岗区网站建设徐州seo招聘
  • 网站返回404关键词搜索引擎排名查询
  • 做视频可以领钱的网站新媒体seo指的是什么
  • 界首工程建设信息网站推广普通话的意义论文
  • 公司网站开发详细流程网络推广怎么找客户
  • 怎样在wordpress页面嵌入div刷百度关键词排名优化