问题标题: 酷町堂:1094 1163

0
0
已解决
王月
王月
资深守护
资深守护

不会啊……

有大佬吗

求思路+部分代码

王月在2021-07-21 21:16:46追加了内容

1163已解决,仅剩1094

也可以不发代码

只发思路也行

王月在2021-07-21 21:33:28追加了内容

1094WA16答案:

#include<iostream>

#include<cstdio>

#include<cmath>

#include<cstring>

#include<algorithm>

#include<string>

#include<iomanip>

#include<sstream>

using namespace std;

int n,cnt,pos;

int main(){

    string s1,s2;

    getline(cin,s1);

    getline(cin,s2);

    if(s1.size()>s2.size()){

        int x=s1.find(s2);

        if(x!=-1){

            cout<<s1<<" is included in "<<s2;

        }

        else{

            cout<<"No including";

        }

    }

    else{

        int x=s2.find(s1);

        if(x!=-1){

            cout<<s2<<" is included in "<<s1;

        }

        else{

            cout<<"No including";

        }

    }

    return 0;

}

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<string>
#include<iomanip>
#include<sstream>
using namespace std;
int n,cnt,pos;
int main(){
	string s1,s2;
	getline(cin,s1);
	getline(cin,s2);
	if(s1.size()>s2.size()){
		int x=s1.find(s2);
		if(x!=-1){
			cout<<s1<<" is included in "<<s2;
		}
		else{
			cout<<"No including";
		}
	}
	else{
		int x=s2.find(s1);
		if(x!=-1){
			cout<<s2<<" is included in "<<s1;
		}
		else{
			cout<<"No including";
		}
	}
	return 0;
}

 

王月在2021-07-21 23:46:41追加了内容

ding


0
已采纳
张展嘉
张展嘉
新手天翼
新手天翼
    if(s2.find(s1)!=-1){
        cout<<s1<<" is included in "<<s2;
    }else if(s1.find(s2)!=-1){
        cout<<s2<<" is included in "<<s1;
    }else{
        cout<<"No including";
    }

 

0
李智宸
李智宸
高级守护
高级守护

string a,b;

    int m,x,y;

    cin>>a>>b>>m>>x>>y;

    if(m>a.size()){

        a.insert(a.size(),b);

        a.erase(x-1,y);

    }

    else{

        a.insert(m-1,b);

        a.erase(x-1,y);

    }

    cout<<a;

0
我要回答