1084 hash
来源:互联网 发布:origin无法连接网络 编辑:程序博客网 时间:2024/06/07 09:21
PAT的hash大多都是结果作为下标,根本不用考虑冲突,数据给的很小
但为啥我就是老过不去这个点?究竟那个数据错了呀
#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>#include<string>using namespace std;int main(){ char s1[90],s2[90],temp,temp2; cin.getline(s1,90); cin.getline(s2,90); bool flag[130]={false}; bool flag2[130]={false}; int lens1 = strlen(s1); int lens2 = strlen(s2); for(int i=0;i<lens2;i++){ flag[s2[i]]=true; flag2[s2[i]]=true; } for(int i = 0; i < lens1; i++) { if(!flag[s1[i]]&&!flag2[s1[i]]&&s1[i]!='_'){ if(s1[i]>='a'&&s1[i]<='z'){ temp=toupper(s1[i]); flag2[temp]=true; } else if(s1[i]>='A'&&s1[i]<='Z'){ temp=s1[i]; temp2=tolower(s1[i]); flag2[temp2]=true; } else temp=s1[i]; printf("%c", temp); //cout<<i; flag2[s1[i]]=true; } } return 0;}
阅读全文
0 0
- 1084 hash
- hash
- Hash
- hash
- hash
- Hash
- hash
- Hash
- HASH
- hash
- hash
- HASH
- hash
- hash
- Hash
- hash
- hash
- Hash...
- 计算机-第一作业-自我介绍
- 二叉查找树、平衡二叉树、红黑树、B-/B+树性能对比
- eclipse如何导出apk文件
- 深度学习训练的小技巧,调参经验。总结与记录。
- usaco training Barn Repair题解
- 1084 hash
- Openssl
- MYSQL中的索引
- c语言 创建动态二维数组 读取txt文件到数组
- java每日一练
- bzoj2150: 部落战争
- java线程安全总结
- 策略模式--js设计模式与开发实践-7
- Oracle--Sequence详解