csp特点:csp的第三题一般是字符串的处理,c++的string类虽然不好用,但是掌握的话在考试的时候可能能省大量的时间。代码:1 #include<iostream> 2 #include<algorithm> 3 #include<string> 4 //利用c++的string类和algorithm的transform函数 5 using namespace std; 6 7 int main() 8 { 9 int fl...
CCF CSP 201409-3 字符串匹配 问题描述 给出一个字符串和多行文字,在这些文字中找到字符串出现的那些行。你的程序还需支持大小写敏感选项:当选项打开时,表示同一个字母的大写和小写看作不同的字符;当选项关闭时,表示同一个字母的大写和小写看作相同的字符。 输入格式 输入的第一行包含一个字符串S,由大小写英...
master ccf-csp/201409-3 字符串匹配 ccf .cpp Go to file Go to file T Go to line L Copy path Cannot retrieve contributors at this time 32 lines (32 sloc) 696 Bytes Raw Blame #include <bits/stdc++.h> using namespace std; int main() { string x; int tag,n; cin>>x>>...
CCFCSP 201909-3 字符画 思路wdnmd CCF的大模拟题最恶心的地方不是代码量大,而是题总是说不明白。这道题需要仔细筛选题干找到题目要求。代码写作1小时,看题3小时才从0到100。 本题注意事项 输出每一个R,G,B对应的值,注意如得到17,输出为"\x31\x37",而非输出17的十六进制(11) 输入为16进制,但不知道...
}intmain(){stringaim; cin>>aim>>type>>n;//aim是需要查找的字符串 type=1字符串敏感 n是测试数目vector<string>vec;stringtemp;while(n--){ cin>>temp; vec.push_back(temp); } vector<string>::iterator ite=vec.begin();if(type==1){//大小写敏感for(;ite<vec.end();ite++){if((*ite)...