2020牛客多校第三场L题Problem L is the Only Lovely Problem(签到)
题意:输入字符串,判断前面6个字符串是否是"lovely"
#include <bits/stdc++.h> #define inf 0x3f3f3f3f using namespace std; const int maxn = 1e5 + 7; typedef long long ll; int main() { int n,m; string s; cin>>s; for(int i=0;i<s.length();i++){ if(s[i]>='A'&&s[i]<='Z') s[i]=s[i]+'a'-'A'; } if(s.substr(0,6)=="lovely" ) { puts("lovely"); return 0; } puts("ugly"); return 0; }