UVA_445:Marvelous Mazes


Language:C++ 4.8.2
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(void)
{
char str[];
int sum;
while()
{
if(fgets(str, sizeof(str), stdin) == NULL)
break;
if(str[] == '\n')
{
printf("\n");
continue;
}
else // 处理读入行
{
int i = ;
while(i < strlen(str))
{
if(str[i] == '!')
{
printf("\n");
i++;
}
sum = ;
while(isdigit(str[i]))
sum += str[i++] - '';
for(int j = ; j < sum; j++)
printf("%c", str[i] == 'b' ? ' ' : str[i]); // 最好用if.else,懒得改了:-
i++; // 缺少此行的话,该程序陷入死循环
}
printf("\n");
} }
return ;
}
UVA_445:Marvelous Mazes的更多相关文章
- Marvelous Mazes
F - Marvelous Mazes Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submi ...
- UVa 445 - Marvelous Mazes
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=s ...
- Marvelous Mazes UVA - 445
#include<iostream> #include<stdio.h> #include<string> #include<cstring> #def ...
- UVA题目分类
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...
- 【索引】Volume 0. Getting Started
AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...
- TOJ 2017: N-Credible Mazes
2017: N-Credible Mazes Time Limit(Common/Java):1000MS/10000MS Memory Limit:65536KByteTotal Subm ...
- CodeForce 377 A mazes(dfs+连通性问题)
Pavel 喜欢网格迷宫.一个网格迷宫是一个 n × m 的长方形迷宫,其中每个单元格要么是空白的,要么是墙体.您可以从一个单元格走到另一个单元格,只要两个单元格均是空白的,且拥有一条公共的边. Pa ...
- History lives on in this distinguished Polish city 2017/1/4
原文 History lives on in this distinguished Polish city Though it may be ancient. KraKow, Poland, is a ...
- SVM(支持向量机)的一点理解
最近有被问到SVM的问题,不懂装懂,羞愧不已.百度有很多深入浅出介绍SVM的文章,我就不赘述了,这里写一点自己肤浅的理解. SVM的核心思想是把求解低维空间上的高维分类器转化为求解高维函数空间上的线性 ...
随机推荐
- Leetcode142. Linked List Cycle II环形链表2
给定一个链表,返回链表开始入环的第一个节点. 如果链表无环,则返回 null. 说明:不允许修改给定的链表. 进阶: 你是否可以不用额外空间解决此题? 方法一:使用map 方法二: 分两个步骤,首先通 ...
- Mac下,spacy配置
pip3 install -U spacy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com python3 -m spa ...
- Redis源码解析:27集群(三)主从复制、故障转移
一:主从复制 在集群中,为了保证集群的健壮性,通常设置一部分集群节点为主节点,另一部分集群节点为这些主节点的从节点.一般情况下,需要保证每个主节点至少有一个从节点. 集群初始化时,每个集群节点都是以独 ...
- 使用yarn代替npm
npm node module package,是nodeJs的包管理工具,最初是有 Isaac Z. Schlueter 开发的,这个让全世界的人都可以很快的运用互相开发的package的工具使no ...
- String--在内存中的表现
创建字符串的方法有两种: Stringstr1=”直接赋值法” Stringstr2=new String(“通过new关键字的方法来创建”); 在执行String str1=” ...
- css3 实现明信片正背面翻转
<!DOCTYPE html> <html lang="zh-cn" style="width: 100%;height: 100%;"> ...
- springMVC原理解析
1:SpringMVC运行原理 2:工作流程 (1)客户端(浏览器)发送请求,直接请求到DispatcherServlet. (2)DispatcherServlet根据请求信息调用HandlerMa ...
- Eviews9.0---软件安装
EViews是Econometrics Views的缩写,直译为计量经济学观察,通常称为计量经济学软件包.它的本意是对社会经济关系与经济活动的数量规律,采用计量经济学方法与技术进行“观察”.计量经济学 ...
- js封装ajax的方法
常用的ajax请求方法封装 /** * ajax请求的封装代码 */ function ajaxPost(url, params, cb) { $.ajax({ type : 'post', url ...
- Leetcode599.Minimum Index Sum of Two Lists
假设Andy和Doris想在晚餐时选择一家餐厅,并且他们都有一个表示最喜爱餐厅的列表,每个餐厅的名字用字符串表示. 你需要帮助他们用最少的索引和找出他们共同喜爱的餐厅. 如果答案不止一个,则输出所有答 ...