Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
135197 徐英杰 字符串包含判断 C++ Accepted 1 MS 272 KB 1233 2025-11-02 18:04:55

Tests(10/10):


Code:

#include <iostream> #include<cmath> using namespace std; void OJ1491(int n) { for (int a = 2;a <= n;a++) { for (int b = 2;b < a;b++) { for (int c = b;c < a;c++) { for (int d = c;d< a;d++) { bool tiaojian=( pow(a,3) == pow(b,3) + pow(c,3) + pow(d,3)); if (tiaojian) { // cout<<"Cube = "<<a<<", Triple = ("<<b<<","<<c<<","<<d<<")"<<endl; printf("Cube = %d, Triple = (%d,%d,%d)\n",a,b,c,d); } } } } } } /* *a b m */ bool OJ1467(string a,string b) { for (int i = 0;i < a.size()-b.size()+1;i++) { bool flg = true; if (b[0] == a[i]) { for (int j = 1;j < b.size();j++) { if (b[j] != a[i+j]) { flg = false; break; } } if (flg) { return true; } } } return false; } int main() { string a; string b; cin>>a>>b; if (OJ1467(a,b)) { cout<<"yes"; }else { cout<<"no"; } return 0; }