字符串的处理
小耗子001
得到的和得不到的都是收获
展开
-
patB1006 换个格式输出整数
#include <iostream>#include <cstdio> #include <cstring>using namespace std;int main(int argc, char** argv) { string str; cin>>str; string::iterator it=str.begin(); switch(str.s...原创 2018-04-15 19:52:06 · 143 阅读 · 0 评论 -
patA1050 String Subtration
#include <iostream>#include <cstdio>#include <cstring>using namespace std;char str1[10001];char str2[10001];int hashT[128]={0}; //record the number;int main(int argc, cha...原创 2018-05-02 15:06:15 · 141 阅读 · 0 评论 -
patB1043 输出PATest
注意:字符串长度的确定要放在循环体外。这样会减少运行的时间。#include <iostream>#include <cstdio>#include <cstring> using namespace std;char strT[6]={'P','A','T','e','s','t'};int hashT[6]={0};int main(int argc, ch...原创 2018-05-02 14:11:19 · 212 阅读 · 0 评论 -
patB1042 字符统计
#include <iostream>#include <cstdio>#include <cstring>using namespace std;int hashT[27]={0};int main(int argc, char** argv) { char str[1200]; gets(str); for(int i=0;i<strlen(str);...原创 2018-05-02 00:00:52 · 188 阅读 · 0 评论 -
patA 1077 Kuchiguse
#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>using namespace std;char ss[101][300]={'0'};int main(int argc, char** argv) { int N; scanf("%d",&N...原创 2018-04-19 20:01:44 · 222 阅读 · 0 评论 -
patA1005 Spell It Right
#include <iostream>#include <cstring>#include <algorithm>using namespace std;string s[10]={"zero","one","two","three","four","five","six","原创 2018-04-18 22:07:40 · 118 阅读 · 0 评论 -
patA1035 Password
#include <iostream>#include <cstring> #include <cstdio>using namespace std;const int maxn=1005;struct person{ char name[20]; char pw[20]; bool flag; person(){ flag=false; }}p[maxn];...原创 2018-04-18 21:33:17 · 148 阅读 · 0 评论 -
patA1001 Format
#include <iostream>#include <cstring>#include <cstdio>#include <algorithm>using namespace std;int num[10];int numsize=0;int main(int argc, char** argv) { int a,b; scanf("%d%d",...原创 2018-04-18 20:08:01 · 195 阅读 · 0 评论 -
patB1048 数字加密
#include <iostream>#include <cstring> #include <algorithm>using namespace std;char map[13]={'0','1','2','3','4','5','6','7','8','9','J','Q','K'};int main(int argc, char** argv) { str...原创 2018-04-17 21:31:07 · 281 阅读 · 0 评论 -
patB1024/A1073 scientic notation
#include <iostream>#include <cstring>using namespace std;int main(int argc, char** argv) { string ss; cin>>ss; string::iterator it=ss.begin(); string se="E"; string sp="."; int pos...原创 2018-04-17 20:09:27 · 207 阅读 · 0 评论 -
patA1061 dating
#include <iostream>#include <cstring>#include <cstdio>#include <iomanip>using namespace std;string date[7]={"MON","TUE","WED","THU","FRI","SAT&qu原创 2018-04-16 21:45:04 · 162 阅读 · 0 评论 -
patB1002 写出这个数
#include <iostream>#include <cstring> #include <algorithm>using namespace std;const int maxn=10000001;int buf[maxn];int num[100];int numsize=0;void change(int x){ do{ num[numsize++]...原创 2018-04-15 20:55:53 · 197 阅读 · 0 评论 -
patB1031 查验身份证
#include <iostream>#include <cstring> using namespace std;int weight[17]={7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};int z[11]={0,1,2,3,4,5,6,7,8,9,10};char m[11]={'1','0','X','9','8','7','6','5...原创 2018-04-15 20:38:53 · 297 阅读 · 0 评论 -
patB1021个位数的统计
#include <iostream>#include <cstring> using namespace std;int hashT[10]={0};int main(int argc, char** argv) { string str; cin>>str; for(string::iterator it=str.begin();it!=str.end();...原创 2018-04-15 20:01:06 · 212 阅读 · 0 评论 -
PatA1082 Read Number in Chinese
#include <iostream>#include <cstdio> #include <cstring>using namespace std;char num[10][5]={"ling","yi","er","san","si","wu","liu","qi"原创 2018-04-21 20:31:09 · 203 阅读 · 0 评论