csu oj 1330 字符识别?
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1330
1330: 字符识别?
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 419 Solved: 296
[Submit][Status][Web Board]
Description
你的任务是写一个程序进行字符识别。别担心,你只需要识别1, 2, 3,如下:
.*. *** ***
.*. ..* ..*
.*. *** ***
.*. *.. ..*
.*. *** ***
Input
输入仅包含一组数据,由6行组成。第一行为字符的个数n(1<=n<=10)。以下5行每行包含4n个字符。每个字符恰好占5行3列,然后是一个空列(用"."填充)。
Output
输出应包含一行,即识别出的各个字符。
Sample Input
3
.*..***.***.
.*....*...*.
.*..***.***.
.*..*.....*.
.*..***.***.
Sample Output
123 分析: 直接判断a[4][1] a[4][3] a[4][3]是否等于“*” 即可。
AC代码:
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <iomanip>
#include <vector>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#pragma warning(disable:4786) using namespace std; const int INF = 0x3f3f3f3f;
const int MAX = + ;
const double eps = 1e-;
const double PI = acos(-1.0); int main()
{
int n , i;
char str[][];
scanf("%d",&n);
for(i = ;i <= ;i ++)
cin >> str[i] + ;
n *= ;
for(i = ;i <= n;i += )
{
if(str[][i] == '*')
cout << "";
else if(str[][i + ] == '*')
cout << "";
else
cout << "";
}
puts("");
return ;
}
csu oj 1330 字符识别?的更多相关文章
- CSU 1330 字符识别? 【找规律】
你的任务是写一个程序进行字符识别.别担心,你只需要识别1, 2, 3,如下: .*. *** *** .*. ..* ..* .*. *** *** .*. *.. ..* .*. ...
- csu oj 1339: 最后一滴血
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1339 1339: 最后一滴血 Time Limit: 1 Sec Memory Limit: 1 ...
- csu oj 1811: Tree Intersection (启发式合并)
题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1811 给你一棵树,每个节点有一个颜色.问删除一条边形成两棵子树,两棵子树有多少种颜色是有 ...
- csu oj 1804: 有向无环图 (dfs回溯)
题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1804 中文题意就不说了. dfs从底到根回溯即可,看代码应该能清楚. //#pragma ...
- csu oj 1344: Special Judge
Description Given a positive integer n, find two non-negative integers a, b such that a2 + b2 = n. I ...
- csu oj 1343 Long Long
Description 现在有两个单调递增序列,第一个序列有N个整数,第二个序列有M个整数,现在你可以从第一个序列中选一个数x,然后从第二个序列中选一个数y,那么有多少种情况满足x+y<=K呢? ...
- csu oj 1341 string and arrays
Description 有一个N*N的字符矩阵,从上到下依次记为第1行,第2行,……,第N行,从左至右依次记为第1列,第2列,……,第N列. 对于这个矩阵会进行一系列操作,但这些操作只有两类: (1) ...
- CSU OJ 1340 A Sample Problem
Description My girlfriend loves 7 very much, she thinks it is lucky! If an integer contains one or m ...
- 合工大OJ 1330 种树
Description 某校大门外长度为L的马路上有一排树,每两棵相邻的树之间的间隔都是1米.我们可以把马路看成一个数轴,马路的一端在数轴0的位置,另一端在L的位置:数轴上的每个整数点,即0,1,2, ...
随机推荐
- java获取类路径
String file = MessageTask3.class.getResource("").getFile(); File: public static final Stri ...
- 深入理解Javascript闭包 新手版
一.什么是闭包? “官方”的解释是:所谓“闭包”,指的是一个拥有许多变量和绑定了这些变量的环境的表达式(通常是一个函数),因而这些变量也是该表达式的一部分. 相信很少有人能直接看懂这句话,因为他描述 ...
- yii1.1.3主从(多从)、读写分离配置
从新配置main.php片段 代码如下 ----------------------------------------------------------- 'db'=>array( 'con ...
- EFI
有CSM的UEFI BIOS应该可以支持EFI Native和legacy两种启动方式吧,在BIOS SETUP选项里面有的选. EFI在开机时的作用和BIOS一样,就是初始化PC,但在细节上却又不一 ...
- Mschat控件示例升级错误处理方法
将具有 3.5 版图表控件的 ASP.NET 3.5 网站升级到 ASP.NET 4 需要更改 web.config 和注册指令 将具有 3.5 版图表控件的 ASP.NET 3.5 网站升级到 AS ...
- readonly=“readonly”与readonly=“true”
<input id="u" readonly /> <input id="u" readonly="readonly" / ...
- Magento打印(配送单、退款单、发票)时PDF中的乱码问题
我使用Magento1.4.2,在其自带的TTF文件不能很好地解析中文字符,TTF文件的位置在网站根目录下的/lib/LinLibertineFont/中.打印的中文字符都是这样的 解决方法: 1.在 ...
- vertical-align的理解
vertical-align的理解 定义和用法 vertical-align 属性设置元素的垂直对齐方式 该属性定义行内元素的基线相对于该元素所在行的基线的垂直对齐 也就是说 它只是个适用行内元素的属 ...
- https://my.oschina.net/huangyong/blog/161419
https://my.oschina.net/huangyong/blog/161419
- Shell函数语法
Shell函数语法 定义函数: function 函数名(){ 指令... } 调用函数,方法1: 函数名 调用函数,方法2: 函数名 参数一 参数二 return在函数里面使用会跳出函数并 ...