1 条题解

  • 1
    @ 2024-4-27 17:18:20
    //注意不忽略空格 写完了string deletespace(string a)才发现,,,
    #include <iostream>
    #include <cstring>
    
    using namespace std;
    
    string a, b;
    
    int main() {
        getline(cin, a);
        getline(cin, b);
        int len = a.size() < b.size() ? a.size() : b.size();
        for (int i = 0; i < len; i ++) {
            if (a[i] == b[i]) cout << i + 1 << ' ';
        }
        
        return 0;
    }
    
    • 1

    信息

    ID
    44
    时间
    1000ms
    内存
    64MiB
    难度
    7
    标签
    递交数
    130
    已通过
    32
    上传者