上一页 1 ··· 7 8 9 10 11 12 13 下一页
摘要: 1042 字符统计 (20分) 本题只让输出小写字母 小写字母转换为数字0~25 输出的时候再转换回来 #include<iostream> #include<vector> #include<cctype> #include<map> #include<set> #include<sstream> 阅读全文
posted @ 2020-06-11 19:25 chstor 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 1039 到底买不买 (20分) 甲级也有一样的题 #include<iostream> #include<vector> #include<cctype> #include<algorithm> #include<sstream> #include<string> #include<cstdio> 阅读全文
posted @ 2020-06-11 19:24 chstor 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 1038 统计同成绩学生 (20分) #include<iostream> #include<vector> #include<cctype> #include<algorithm> #include<sstream> #include<string> #include<cstdio> const 阅读全文
posted @ 2020-06-11 19:22 chstor 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 测试点2有个坑就是不能用cin来输入字符 题目保证第二行输入非空,第一行可能是空,cin读不了空字符 #include<iostream> #include<vector> #include<cctype> #include<algorithm> #include<sstream> #include 阅读全文
posted @ 2020-06-11 08:27 chstor 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 1029 旧键盘 (20分) 用str【200】来标记已经输出的字符,散列查找 #include<iostream> #include<vector> #include<ctype.h> #include<algorithm> #include<sstream> #include<string> # 阅读全文
posted @ 2020-06-11 08:24 chstor 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1015 德才论 (25分) 分四个等级的排序,想简化的朋友可以用结构体数组容器存储啦~ #include<iostream> #include<vector> #include<ctype.h> #include<algorithm> #include<sstream> #include<stri 阅读全文
posted @ 2020-06-10 19:56 chstor 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 1024 科学计数法 (20分) substr():substr(起始位置,往后要几个字符) stoi():string转换为int,参数必须是字符串,字符的话用substr(ch,1)转换为字符串 常用字符串处理函数: 参数是字符即可 isalpha();//是否为字母 isdigit();//是 阅读全文
posted @ 2020-06-10 11:04 chstor 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 1014 福尔摩斯的约会 (20分) 这道题坑多,看清题目要求 第 1 对相同的大写英文字母(大小写有区分)是第 4 个字母 D,只能是A~G 第 2 对相同的字符:0 点到 23 点由数字 0 到 9、以及大写字母 A 到 N 表示 后面两字符串第 1 对相同的英文字母 s 出现在第 4 个位置( 阅读全文
posted @ 2020-06-10 10:58 chstor 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1031 查验身份证 (15分) 把不符合的输出 没有就输出All passed #include<iostream> #include<ctype.h> #include<sstream> #include<string> #include<cstdio> const int maxn=110; 阅读全文
posted @ 2020-06-10 10:50 chstor 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 知道stringstream这个类型就很简单 用于把空格过滤掉 stringstream ss(s);//初始化ss string word; int cnt=0; while(ss >> word){ str[cnt++]=word;//将输入的一行字符串依次存入字符串数组中 } #include 阅读全文
posted @ 2020-06-09 18:57 chstor 阅读(209) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 下一页