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 ...
随机推荐
- ZedGraph类库之基本教程篇
第一部分:基本教程篇 ZedGraphDemo中一共有9个基本教程的例子.其中大部分都类似,我会讲解其中一些比较典型的例子.把ZedGraph类库的使用逐步展现给大 ...
- 从request获取各种路径总结 request.getRealPath("url")
转载:http://blog.csdn.net/piaoxuan1987/article/details/8541839 equest.getRealPath() 这个方法已经不推荐使用了,代替方法是 ...
- mybatis 控制器注解介绍(一)
@RequestMapping("LoginController")public class LoginController { // 路径参数{name}填入用户名,{pass} ...
- c#中{set;get;}使用逻辑
(先把结论提前)下面两种定义私有变量配合公有变量的方法都没有意义,除非有特殊的逻辑需要在set或get中,其它情况都等效于 public GM_Arc Arc {set;get;} //不进行初始化, ...
- 什么是DA控制
液压系统中的DA控制: Automotive Drive control & Anti stall control 自动变速控制 & 防熄火控制 (DA控制) 1:自动(变速)驱动控制 ...
- flask系列三之Jinja2模板
1.如何渲染模板 模板在‘templates’文件夹下(htnl页面) 从flask中导入render_template函数---渲染html模板 在视图函数中,使用render_template 函 ...
- HALCON 算子函数(四) File
HALCON 算子函数——Chapter 4 : File 4.1 Images 1. read_image 功能:读取有不同文件格式的图像. 2. read_sequence 功能:读取图像. 3. ...
- leetcode804
int uniqueMorseRepresentations(vector<string>& words) { map<char, string> st; st.ins ...
- 第01章 开发准备(对最新版的RN进行了升级)1-4 项目底部导航菜单开发
- 633. Sum of Square Numbers 是否由两个完全平方数构成
[抄题]: Given a non-negative integer c, your task is to decide whether there're two integers a and b s ...