#include<iostream>#include<cmath>#include<algorithm>#include<vector>usingnamespace std;typedeflonglong ll;intmain(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);for(char c ='a'; c <='m'; c++){
cout << c;}
cout << endl;for(char c ='n'; c <='z'; c++){
cout << c;}
cout << endl;for(char c ='z'; c >='n'; c--){
cout << c;}
cout << endl;for(char c ='m'; c >='a'; c--){
cout << c;}
cout << endl;return0;}
1101. 时间的差
#include<iostream>#include<vector>#include<algorithm>#include<string>#include<cmath>typedeflonglong ll;usingnamespace std;static ll num(string s){
ll r =0;//01:10:10
ll h =(s[0]-'0')*10+(s[1]-'0');
ll m =(s[3]-'0')*10+(s[4]-'0');
ll e =(s[6]-'0')*10+(s[7]-'0');
r = h *60*60+ m *60+ e;return r;}intmain(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string s1, s2;
cin >> s1 >> s2;
cout <<num(s1)-num(s2)<< endl;return0;}
1115. 数字和
#include<iostream>#include<cmath>#include<algorithm>#include<vector>#include<string>usingnamespace std;typedeflonglong ll;intmain(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string s;getline(cin, s);
ll l = s.size(), sum =0;for(ll i =0; i < l; i++){
sum += s[i]-'0';}
cout << sum << endl;return0;}
1134. 国王的魔镜
#include<iostream>#include<vector>#include<cmath>#include<string>#include<algorithm>usingnamespace std;typedeflonglong ll;boolpalin(string s,int end){bool f;if((end +1)%2==0){
f =true;for(int i =0; i <= end /2; i++){if(s[i]!= s[end - i]){
f =false;break;}}}else{returnfalse;}return f;}intmain(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
string s;
cin >> s;
ll end = s.size()-1;while(palin(s, end)){
end /=2;}
cout << end +1<< endl;return0;}
1387. 简单加密
#include<iostream>#include<cmath>#include<algorithm>#include<string>#include<vector>usingnamespace std;typedeflonglong ll;intmain(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string s;getline(cin, s);
ll len = s.size();for(ll i =0; i < len; i++){if(isupper(s[i])){if(s[i]>='F'&& s[i]<='Z'){
s[i]-=5;}else{
s[i]= s[i]+('V'-'A');}}}
cout << s << endl;return0;}
1480. 找字典码最小的字符串
#include<iostream>#include<cmath>#include<algorithm>#include<vector>usingnamespace std;typedeflonglong ll;intmain(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll n;
cin >> n;
string mins, s;
cin >> mins;for(ll i =2; i <= n; i++){
cin >> s;if(s < mins) mins = s;}
cout << mins << endl;return0;}