1222: FJ的字符串 [水题]
1222: FJ的字符串 [水题]
时间限制: 1 Sec 内存限制: 128 MB
提交: 92 解决: 20 统计
题目描述
FJ在沙盘上写了这样一些字符串:
A1 = “A”
A2 = “ABA”
A3 = “ABACABA”
A4 = “ABACABADABACABA”
… …
你能找出其中的规律并写所有的数列AN吗?
输入
仅有一个数:N ≤ 26。
输出
请输出相应的字符串AN,以一个换行符结束。输出中不得含有多余的空格或换行、回车符。
样例输入
2
3
样例输出
ABA
ABACABA
递归思想,感觉自己好弱
#include<stdio.h>
#include<iostream>
#include<math.h>
#include<string.h> using namespace std; void solve(int x)
{
if(x == )
{
printf("A");
}
else
{
solve(x-); printf("%c", 'A'+x-); solve(x-);
}
}
int main()
{
int n;
char ch[]; while(scanf("%d", &n) != EOF)
{
solve(n);
printf("\n");
} return ;
}
1222: FJ的字符串 [水题]的更多相关文章
- 1001 字符串“水”题(二进制,map,哈希)
1001: 字符串“水”题 时间限制: 1 Sec 内存限制: 128 MB提交: 210 解决: 39[提交][状态][讨论版] 题目描述 给出一个长度为 n 的字符串(1<=n<= ...
- 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题
B - 大还是小? Time Limit:5000MS Memory Limit:65535KB 64bit IO Format: Description 输入两个实数,判断第一个数大 ...
- HDU ACM 1073 Online Judge ->字符串水题
分析:水题. #include<iostream> using namespace std; #define N 5050 char a[N],b[N],tmp[N]; void Read ...
- HDU4891_The Great Pan_字符串水题
2014多校第五题,当时题面上的10^5写成105,我们大家都wa了几发,改正后我和一血就差几秒…不能忍 题目:http://acm.hdu.edu.cn/showproblem.php?pid=48 ...
- Codeforces Round #309 (Div. 2) B. Ohana Cleans Up 字符串水题
B. Ohana Cleans Up Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/554/pr ...
- Codeforces Round #309 (Div. 2) A. Kyoya and Photobooks 字符串水题
A. Kyoya and Photobooks Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/5 ...
- uva 10252 - Common Permutation 字符串水题
题意:給定兩個小寫的字串a與b,請印出皆出現在兩字串中的字母,出現的字母由a~z的順序印出,若同字母出現不只一次,請重複印出但不能超過任一字串中出現的次數.(from Ruby兔) 很水,直接比较输出 ...
- hdu1106 字符串水题strtok()&&strchr()&&sscanf()+atoi()使用
字符串的题目 用库函数往往能大大简化代码量 以hdu1106为例 函数介绍 strtok() 原型: char *strtok(char s[], const char *delim); 功能: 分解 ...
- codeforces 112APetya and Strings(字符串水题)
A. Petya and Strings 点击打开题目 time limit per test 2 seconds memory limit per test 256 megabytes input ...
随机推荐
- python内置常用内置方法详解
# print(locals()) # print(globals()) def func(): x = 1 y = 1 print(locals()) # 函数内部的变量 print(globals ...
- oracle插入
普通插入方式: insert into t select * from t2; append插入方式: insert /*+append*/ into t select * from t2; Appe ...
- 内网渗透神器xerosploit
项目地址:https://github.com/LionSec/xerosploit 安装完成后直接在终端输入xerosploit打开 显示了本机的内网ip,mac地址,网关,网卡,输入help查看帮 ...
- swift一次 Attempt to present on whose view is not in the window hierarchy的解决方法
做的是二维码扫描,扫描后识别为URL的话就跳转到webview 加载网页,用的是代理传值的方式.扫描到了 值传递到主页 扫描窗体退出,检测值是否是http://开头 是网页就跳转. 问题出在传值到主界 ...
- Tornado 高并发源码分析之五--- IOLoop 对象
IOLoop主要工作 1.将TCPServer 注册到 IOLoop 的事件记到 _handlers 字段,同时注册 READ 和 ERROR 事件到 epoll 2.IOLoop 启动一个大循环,负 ...
- android 除法运算保留小数点
java保留两位小数问题: 方式一: 四舍五入 double f = 111231.5585; BigDecimal b = new BigDecimal(f); double f1 = b.setS ...
- 后台运行python程序 遇到缓冲区问题
From: http://www.iteye.com/topic/867446 环境:linux 一段执行时间很长的程序(用python做hive客户端执行mapreduce) 在linux后台执行, ...
- file_get_content() 超时
set_time_limit 只能影响php 程序的超时时间. file_get_contents 读取的是URL的超时时间. 因此 set_limit_limit 对file_get_conte ...
- orzdba工具安装注意事项
orzdba是一个监控mysql性能的一个比较好用的perl脚本,是淘宝开源的小工具,下载地址http://code.taobao.org/p/orzdba/src/trunk/ 配置过程中除了参照& ...
- ROS naviagtion analysis: costmap_2d--Layer
博客转载自:https://blog.csdn.net/u013158492/article/details/50493113 这个类中有一个LayeredCostmap* layered_costm ...