401

刘汝佳分类第一题,用map处理的
刚看了看别人怎么处理的,发现了一种映不错的射方法:
char m[40] = "A###3##HIL#JM#O###2TUVWXY5#1SE#Z##8#";
大概就这样
ContractedBlock.gifExpandedBlockStart.gif401
1 #include <iostream>
2 #include <map>
3 #include <cstdio>
4 #include <cstring>
5 #include <string>
6 #include <cmath>
7 using namespace std;
8
9 char s[200];
10 char s1[14] = "AHIMOTUVWXY18";
11 char s2[9] = "EJZS25L3";
12 int tag, len;
13
14 map <char, int> table1;
15 map <char,char> table2;
16
17 int main()
18 {
19 //freopen("a.txt", "r", stdin);
20 for(int i = 0;i < 13;i++)
21 {
22 table1[s1[i]] = 1;
23 }
24 for(int i = 0;i < 8;i++)
25 {
26 table2[s2[i]] = s2[7-i];
27 //printf("%c ", table2[s2[i]]);
28 }
29 while(gets(s))
30 {
31 printf("%s -- ", s);
32 len = strlen(s);
33 tag = 1;
34 for(int i = 0;i < len;i++)
35 {
36 if(table1[s[i]] == 0)
37 {
38 tag = 0;
39 break;
40 }
41 if(s[i]!=s[len-1-i])
42 {
43 tag = 0;
44 break;
45 }
46 }
47 if(tag == 1)
48 {
49 printf("is a mirrored palindrome.\n\n");
50 continue;
51 }
52 tag = 1;
53 for(int i = 0;i < len;i++)
54 {
55 if(table2[s[i]] == s[len-1-i]||(table1[s[i]] == 1&&s[i] == s[len-1-i]))
56 {
57 continue;
58 }
59 else
60 {
61 tag = 0;
62 break;
63 }
64 }
65 if(tag == 1)
66 {
67 printf("is a mirrored string.\n\n");
68 continue;
69 }
70 tag = 1;
71 for(int i = 0;i < len;i++)
72 {
73 if(s[i]!=s[len-1-i])
74 {
75 tag = 0;
76 break;
77 }
78 }
79 if(tag == 1)
80 {
81 printf("is a regular palindrome.\n\n");
82 continue;
83 }
84 else printf("is not a palindrome.\n\n");
85 }
86 return 0;
87 }

转载于:https://www.cnblogs.com/ACKOKO/articles/2043877.html

含以下CANopen 协议及子协议,请选择 DS301 规范了对应用层、通信子协议进行了全面描述外,还为特定的应用提供了扩展架构,定义了更多规则和特殊通信对象。例如:定义 了网络管理对象(节点保护,寿命保护),并定义了使用这些对象的详细规则,是包含通信接口、应用过程以及对象字典的CANopen设备的基本 模型 DS301 应用层 DS302 CANopen 管理结构与可编程驱动器 DS303 1接线接头说明,2国际单位的表示和前缀,3指示灯说明(1,2,3) DS304 网络安全结构及相关说明 DS305 无 DS306 EDS电子数据表说明 DS308 性能测量说明 DS309 TCPIP(1,2,3) 1-通用原则与服务 2-Modbus/TCP 影射 3-ASCII码影射 EDS 文件规范 设备子协议: 通常命名编号为DS4XX DS401 通用IO模块 DS402 电机驱动器 DS404 闭环测控仪器 DS405 可编程设备 DS406 旋转与线性编码器 DS408 无 DS410 角度测量仪 DS412 医疗器械(1,2,6),1--通用定义,2---X光准直仪,3--x光发生器,4--疾人表配置,5--X光标准,6--剂量测量系统 DS414 织布机驱动(1,2) 1--通用定义 2--馈线 DS417 升降控制器 DS418 电池驱动模块 DS419 电池充电器 DS420 挤压设备(1,2,3,4,5,6) DS422 市政车辆 DS801 CANopen Automactic bit-rate detection DS802 CANopen CAN remote frames 远程帧-避免使用 DS808 CANopen CiA 444 应用注释和实施指南 CANopen CiA 444 application note and implementation guideline DS201207 DSV1.1 工业应用的应用层
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值