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, ...
随机推荐
- storm-kafka-0.8-plus 源码解析
https://github.com/wurstmeister/storm-kafka-0.8-plus http://blog.csdn.net/xeseo/article/details/1861 ...
- JAVA 调用matlab 出错总结
1.Java:Unsupported major.minor version 51.0 (unable to load class 出现该错误是由于class编译器的JDK版本高于运行期的JDK版本. ...
- vm设置静态ip
1. 进入虚拟linux系统中,vim /etc/sysconfig/network-scripts/ifcfg-eth0,里面保留以下内容即可: DEVICE=eth0 //使用的网卡标识 BOOT ...
- memache session
Memcache和PHP memcach扩展安装请见http://koda.iteye.com/blog/665761 设置session用memcache来存储 方法I: 在 php.ini 中全局 ...
- struct stat结构体的详解和用法
[cpp] view plaincopy //! 需要包含de头文件 #include <sys/types.h> #include <sys/stat.h> S_ISLNK( ...
- XPS to Blender 2.7x
XPS to Blender 2.7x(Blender internal the easy way) Things we are gonna need are Blender 2.7x www.ble ...
- C#引用类型与值类型的比较
using System; using System.Collections.Generic; using System.Linq; using System.Text; using SimpleDe ...
- 转一个 C#基础类库
转自:http://www.cnblogs.com/sufei/archive/2012/12/07/2807170.html http://www.sufeinet.com/thread-655-1 ...
- HD 1003 Max Sum 的递归解法
#include <STDIO.H> typedef struct SU_tag{ SU_tag(){} SU_tag(int a,int b,int c):max_sum(a),left ...
- ActiveMQ发布订阅模式
ActiveMQ的另一种模式就SUB/HUB即发布订阅模式,是SUB/hub就是一拖N的USB分线器的意思.意思就是一个来源分到N个出口.还是上节的例子,当一个订单产生后,后台N个系统需要联动,但有一 ...