poj 1302 Blue Gene, Jr. 递归
来源:互联网 发布:halo2 windows live 编辑:程序博客网 时间:2024/05/21 14:49
//poj 1302//sep9#include <iostream>using namespace std;char s[32];int n;int f(int cur){if(cur==n||s[cur]=='0'){return 0;}if(s[cur]>='A'&&s[cur]<='Z'){int t=f(cur+1);s[cur]=t%10+'0';return t+1;}if(s[cur]>='1'&&s[cur]<='9'){int t=s[cur]-'0';--s[cur];if(cur+t<n)return f(cur+t)+1;elsereturn f(cur+1)+1;}}int main(){while(scanf("%s",s)==1){if(strcmp(s,"ENDOFINPUT")==0)break;scanf("%d%s%*s",&n,s);f(0);puts(s);}return 0;}
0 0
- poj 1302 Blue Gene, Jr. 递归
- POJ 1302 Blue Gene, Jr.解题报告
- Deep into Blue Gene @ JDJ
- poj 3080 Blue Jeans
- poj 3080 Blue Jeans
- poj 3080 Blue Jeans
- poj 3080 Blue Jeans
- poj 3080 Blue Jeans
- POJ 3080 Blue Jeans
- POJ 3080 Blue Jeans
- POJ 3080 Blue Jeans
- POJ 3080 Blue Jeans
- Poj 3080 Blue Jeans
- POJ 3080 Blue Jeans
- POJ 3080 Blue Jeans
- POJ 3080 Blue Jeans
- poj 3080 Blue Jeans
- poj 3080 Blue jeans
- 大学生字体如"打印体" 网友称:太强大
- 32.c/c++程序员面试宝典-类成员函数
- 在PHP语言中使用JSON
- python自学笔记 20151126
- C++primer plus第六版课后编程练习答案6.5
- poj 1302 Blue Gene, Jr. 递归
- 同步MySQL表结构
- freeswitch会议模块lua脚本
- struts2 流程分析
- Java 与无符号那些事儿
- PHP与MySQL开发中的字符编码问题
- 开源库ZXing加入xcode工程报错几个原因及解决方法
- python3.X安装matplotlib简单方法
- Leetcode172: Minimum Size Subarray Sum