跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
社群首页
帮助
希顶相关网站
希顶社区官网
(原作)希顶翻译器
〇改希顶转写器
希顶模组服务器
搜索
搜索
创建账号
登录
个人工具
创建账号
登录
查看“User:ColorfulGalaxy/Programs”的源代码
用户页
讨论
不转换
不转换
简体
繁體
新加坡简体
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
用户贡献
日志
查看用户组
特殊页面
页面信息
查看头像
←
User:ColorfulGalaxy/Programs
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于这些用户组的用户执行:
用户
、storagereadable
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
<pre class="mw-collapsible">#define PROGRAM #include <cstdio> #include <cstring> #define elif else if // Input ends in newline char c=0; //input char iq[8]; //input queue int iql=0; //input queue length const int lev[256]={ 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, //16 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, //32 000040,000041,000042,000000, 000044,000000,000000,000047, 000050,000051,000052,000053, 000054,000055,000056,000057, //48 +57543,0xe09c,0xe097,0xe09a, 0xe066,0xe067,0xe096,0xe06a, 0xe099,+57503,000072,000073, 000074,000075,000076,000077, //64 000000,0xe093,0xe06b,+57550, 0xe03b,0xe092,0xe069,+57546, 0xe03e,+57547,+57538,+57544, 0xe095,+57549,0xe03f,+57542, //80 +57537,+57545,+57540,+57548, 0xe098,+57539,0xe09b,+57536, +57502,0xe094,+57541,000000, 000000,000000,000000,000002, //96 000003,0xe06f,0xe021,0xe06c, 0xe061,0xe091,0xe06d,0xe063, 0xe065,0xe09d,0xe035,0xe054, 0xe060,0xe033,0xe039,0xe090, //112 0xe032,0xe036,0xe03d,0xe03c, 0xe062,0xe06e,0xe068,0xe034, 0xe037,0xe038,0xe03a,000000, 000000,000000,000007 };//ASCII to PUA (Level) const int gra[256]={ 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, //16 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, //32 000000,0xe020,000000,000000, +57637,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, //48 000000,000000,000000,000000, 000000,+57590,+57636,000000, +57589,000000,000000,000000, 000000,000000,000000,000000, //64 000000,000000,+57598,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, +57634,000000,+57595,+57597, //80 +57585,+57587,+57586,000000, 000000,000000,000000,+57639, 000000,+57593,000000,000000, 000000,000000,000000,000000, //96 000000,+57594,000000,000000, 000000,000000,000000,+57632, 000000,000000,000000,+57588, 000000,+57591,+57640,000000, //112 +57635,+57599,+57584,+57551, 000000,000000,+57633,+57592, +57596,+57638 };//ASCII to PUA (Grave) const int cen[256]={ 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, //16 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, //32 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,0xe00c,000000, //48 0xe00a,0xe001,0xe002,0xe003, 0xe004,0xe005,0xe006,0xe007, 0xe008,0xe009,000000,000000, 000000,000000,000000,000000, //64 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, 000000,000000,000000,000000, //80 000000,000000,000000,000000, 0xe00b }; void push(char c1){ if(iql>sizeof(iq)){ throw("e001 queue overflow"); } iq[iql]=c1; iql+=1; } void clear(char c1=0){ memset(iq,0,sizeof(iq)); iq[0]=c1; iql=!!c1; } void print(char c1=0){ if(iql==0){ ; } elif(iq[0]==-30 && iq[1]==-121 && iq[2]==-89){ if(iq[4]==96){ if(gra[iq[3]]<129){ throw("e002 space and punctuation can not be capitalized"); } printf("%c%c%d;",38,35,gra[iq[3]]-16); } if(iql==4){ if(lev[iq[3]]<129){ throw("e003 space and punctuation can not be capitalized"); } printf("%c%c%d;",38,35,lev[iq[3]]-16); } } elif(iq[0]==126){ if(iq[2]==96){ if(gra[iq[1]]<129){ throw("e004 space and punctuation can not be made middle case"); } printf("%c%c%d;",38,35,gra[iq[1]]+16); } if(iql==2){ if(lev[iq[1]]<129){ throw("e005 space and punctuation can not be made middle case"); } printf("%c%c%d;",38,35,lev[iq[1]]+16); } } elif(iq[0]==37){ if(iq[2]==37){ printf("%c%c%d;",38,35,cen[iq[1]]); } else { printf("%s",iq); } } elif(iq[1]==96){ if(gra[iq[0]]<10){ throw("e006 unidentified character"); } elif(gra[iq[0]]<127){ printf("%s",iq); } else { printf("%c%c%d;",38,35,gra[iq[0]]); } } elif(iql==1){ if(lev[iq[0]]<10){ throw("e007 unidentified character"); } elif(lev[iq[0]]<127){ printf("%s",iq); } else { printf("%c%c%d;",38,35,lev[iq[0]]); } } else { throw("e00f unknown error"); } clear(c1); } int main() { try{ while(c!=10&&c!=13){ c=getchar(); if(c==10){ print(); puts(""); } elif(c==13){ ; } elif(iql==0){ push(c); } elif(c==-30){ print(c); //Capital sign } elif(iql==1&&c==-121){ push(c); } elif(iql==2&&c==-89){ push(c); } elif(31<c&&c<126&&c!=96){ if(iq[0]==-30 && iq[1]==-121 && iq[2]==-89 && iql==3){ push(c); } elif(iq[0]==126 && iql==1){ push(c); } elif(iql>1&&iq[iql-1]==96){ print(c); } elif(31<iq[iql-1]&&iq[iql-1]<126){ print(c); } else { push(c); } } elif(c==96){ push(c); } elif(c==126){ print(c); } else { push(c); } } print(); }catch(const char message[]){ fputs(message,stderr); //Swap the two arguments if not working } return 0; }</pre>
该页面使用的模板:
Template:Dup
(
查看源代码
)
Template:Info
(
查看源代码
)
Template:Mbox
(
查看源代码
)
返回
User:ColorfulGalaxy/Programs
。
开关有限宽度模式