Encoded Love-letter
Encoded Love-letter
Time Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)
Total Submission(s) : 35 Accepted Submission(s) : 14
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char c[];
int main()
{
int n,i,sign1,sign2,j,k;
char a[],b[];
gets(a);
sign1=strlen(a);
for(i=;i<;i++)
{
b[i]='A'+i;
b[i+]='a'+i;
}
for(i=;i<sign1;i++)
{
a[i+]=a[i]+;
}
for(i=sign1,j=;i<;i++,j++)
{
a[i]='Z'-j;
a[i+]='z'-j;
for(k=;k<sign1;k++)
if(a[i]==a[k])
{
i--;break;
}
}
while(gets(c))
{
sign2=strlen(c);
for(i=;i<sign2;i++)
{
if(c[i]>='A'&&c[i]<='Z')
for(k=;k<;k++)
if(c[i]==a[k])
{
c[i]=b[k];break;
}
if(c[i]>='a'&&c[i]<='z')
for(k=;k<;k++)
if(c[i]==a[k])
{
c[i]=b[k];break;
}
}
printf("%s\n",c);
}
return;
}
Encoded Love-letter的更多相关文章
- B - Encoded Love-letter 字符串的处理
B - Encoded Love-letter Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & % ...
- CodeChef KILLKTH Killjee and k-th letter
题意 dt { font-weight: bold; margin-top: 20px; padding-left: 35px; } dd { box-shadow: 3px 3px 6px #888 ...
- HDU 1591 Encoded Love-letter(简单字符串)
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission( ...
- [LeetCode] Letter Combinations of a Phone Number 电话号码的字母组合
Given a digit string, return all possible letter combinations that the number could represent. A map ...
- Example: Encoded SNMP Message - SNMP Tutorial
30.11 Example Encoded SNMP Message The encoded form of ASN.1 uses variable-length fields to represen ...
- 17. Letter Combinations of a Phone Number
题目: Given a digit string, return all possible letter combinations that the number could represent. A ...
- 什么是Unicode letter
起因:从一段代码说起 using System; using System.Collections.Generic; using System.Linq; using System.Text; usi ...
- LeetCode——Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent. A map ...
- No.017:Letter Combinations of a Phone Number
问题: Given a digit string, return all possible letter combinations that the number could represent.A ...
随机推荐
- 树:BST、AVL、红黑树、B树、B+树
我们这个专题介绍的动态查找树主要有: 二叉查找树(BST),平衡二叉查找树(AVL),红黑树(RBT),B~/B+树(B-tree).这四种树都具备下面几个优势: (1) 都是动态结构.在删除,插入操 ...
- Crazy-Links
1. 数据模型 2. Admin Formset RED is customized class |- object |- AdminForm |- InlineAdminForm |- BaseFo ...
- shell中$0,$?,$!
变量说明: $$ Shell本身的PID(ProcessID) $! Shell最后运行的后台Process的PID $? 最后运行的命令的结束代码(返回值) $- 使用Set命令设定的Flag一览 ...
- Windows下怎么搭建Python+Selenium的自动化环境
http://jingyan.baidu.com/article/47a29f244aec6bc014239985.html 注意点:配置了环境变量后需要重启电脑
- PostgreSQL ----- No relations found.
本篇文章可能有错,尚未细细研究 运行\d出错: No relations found. \d只显示可见的表,也就是该数据库的schema在search_path中. SHOW search_path; ...
- 基于Bootstrap的炫酷jQuery slider插件
简要教程 这是一款在原生bootstrap slider的基础上制作效果非常炫酷的jQuery slider插件.该slider插件可以自定义slider的颜色.形状.透明度和tooltip等属性,美 ...
- 验证mySqli扩展是否
<?php// createTime: 2016/9/9 21:57 //验证mySqli扩展是否//phpinfo(); //2.检测扩展是否已经加载//var_dump(extension_ ...
- JavaEE 配置文件 应用首选项存储
JavaEE 配置文件 应用首选项存储 @author ixenos 什么是首选项? 首选项Preferences 指配置信息 首选项存储就是指对配置信息的存储 有什么方式存储? 有两种,一种存于 ...
- MVC3+EF4.1学习系列(一)-------创建EF4.1 code first的第一个实例
基于EF4.1 code first 简单的CRUD 园子中已经有很多了 ~~ 真不想再写这个了 可是为了做一个完整的小demo 从开始 到后面的一些简单重构 还是决定认真把这个写出来 争取写些别人 ...
- top.location != self.location
top.location != self.location 就是说当前窗体的url和父窗体的 url是不是相同 这个是为了防止别的网站嵌入你的网站的内容(比如用iframe嵌入的你的网站的页面)