Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
/******************************
* @#author : DyIuWhite
* @#date : oo / oo / oo *
*******************************/
#include<bits/stdc++.h>
#define foru(i,a,b) for( i=a;i<=b;i++)
#define taskname ""
using namespace std;
string s;
long long t,a,b;
int main()
{
if (fopen(taskname".inp", "r"))
{
freopen(taskname".inp", "r", stdin);
freopen(taskname".out", "w", stdout);
}
cin>>s;
cin>>t;
while(t--)
{
cin>>a>>b;
if(s[a-1]==s[b-1])
cout<<1<<'\n';
else cout<<-1<<'\n';
}
return 0;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin