问题标题: 酷町堂:1094

0
0
已解决
张云瀚
张云瀚
初级天翼
初级天翼

题目链接: 酷町堂:1094

#include<iostream>
#include<algorithm>
#include<string> 
using namespace std;
string a,b;
int t,t1;
int main(){
    cin>>a>>b;
    t=b.find(a);
    t1=a.find(b);
    if(t!=-1){
        cout<<a<<" is included in "<<b;
    }else{
        cout<<"No including";
    }
    if(t1!=-1){
        cout<<b<<" is included in "<<a;
    }else{
        cout<<"No including";
    }
    return 0;
}


0
已采纳
崔子周
崔子周
高级天翼
高级天翼

 

整型 t=s1.find(s2);

整型 t1=s2.find(s1);

如果(t!=-1){

输出<<s2<<" is included in "<<s1;

} 否则 如果(t1!=-1){

输出<<s1<<" is included in "<<s2;

} 否则{

输出<<"No including";

}

定义输入自己想

0
0
宋灏
宋灏
初级光能
初级光能

这题

输入整行a,b

整型 x=a.寻找(b);

整型 y=b.寻找(a);

如果(x不等于-1){

输出b," is included in ",a;

}那么如果(y不等于-1){

输出a," is included in ",b;

}那么{

输出"No including";

}

即可

0
宋子墨
宋子墨
新手天翼
新手天翼

你这一题是if判断错了,

if(t!=-1)

{a在b中}

else if(t1!=-1){b在a中}

else{没有}

我要回答