摘要:
#include<bits/stdc++.h> using namespace std; const int N = 1e3+5; int a[N],dp[N]; int n,ans; int main() { cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; dp 阅读全文
摘要:
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { // 读取输入的字符串 string s; cin >> s; // 初始化有效性标志为1(有效) int f = 1; // 定义年、月、 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; int main(){ string a,b; //字符串可能空格,所以使用扫描一整行的方式 getline(cin,a); getline(cin,b); int cnt=0; //统计结果 for(int 阅读全文
摘要:
#include<bits/stdc++.h> #define ll long long using namespace std; int main() { string s; cin>>s; cout<<s<<endl;//先输出原字符串 for(int i=0; i<s.size(); i++) 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; int main() { string a,b; cin>>a>>b; //利用字符串的比较函数 if(a.compare(b)<=0){ cout<<a<<b; }else{ cout<<b<<a; } re 阅读全文
摘要:
#include <bits/stdc++.h> using namespace std; int main(){ string a,b; getline(cin,a); getline(cin,b); //将字符串中所有的字母均转换为小写字母 for(int i=0;i<a.size();i++) 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; int main(){ string a,b; //字符串可能空格,所以使用扫描一整行的方式 getline(cin,a); getline(cin,b); bool f = 0;//1代表是子串,0代表不是 阅读全文
摘要:
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { string s; cin>>s; //利用双指针的方式,L指向第一个字符,R指向最后一个字符 //f标记,0代表不是回文,1代表室回文 i 阅读全文
摘要:
#include <bits/stdc++.h> using namespace std; int main() { string s; cin>>s; cout<<s; //先输出原字符串 s[0]-=32; //首字母变大写 cout<<s; //再输出新的单词 return 0; } 阅读全文
摘要:
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { string s1,s2; getline(cin,s1); getline(cin,s2); //准备两个字符串,把原本字符串空格去掉后存 阅读全文