一个离奇的错误
查看原帖
一个离奇的错误
341353
封禁用户楼主2023/1/3 10:46
Runtime Error.
Received signal 6: Aborted / IOT trap.

代码:

#include <bits/stdc++.h>
using namespace std;

string mod;
int n;

int main(){
    cin>>n>>mod;
    int star=mod.find("*");
    string front=mod.substr(0, star);
    string back=mod.substr(star+1);
    for (string s; n; n--){
        cin>>s;
        string f1=s.substr(0, star);
        string b1=s.substr(s.size()-back.size());
        if (front==f1 && back==b1 && f1.size()+b1.size()<=s.size()) cout<<"DA"<<endl;
        else cout<<"NE"<<endl;
    }
    return 0;
}

我做属于我的题目都做不对,我太蔡了

2023/1/3 10:46
加载中...