#include <bits/stdc++.h>
using namespace std;
bool isSubstring(string s1, string s2)
{
int n = s1.size();
int m = s2.size();
for (int i = 0; i < n - m + 1; i++)
{
int j;
for (j = 0; j < m; j++)
{
if (s1[i + j] != s2[j])
break;
}
if (j == m)
return true;
}
return false;
}
int main()
{
int t;
cin >> t;
while (t--)
{
string s;
cin >> s;
if (isSubstring(s, "101") || isSubstring(s, "010"))
{
cout << "Tasty" << endl;
}
else
cout << "Tasteless" << endl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
bool isSubstring(string s1, string s2)
{
int n = s1.size();
int m = s2.size();
for (int i = 0; i < n - m + 1; i++)
{
int j;
for (j = 0; j < m; j++)
{
if (s1[i + j] != s2[j])
break;
}
if (j == m)
return true;
}
return false;
}
int main()
{
int t;
cin >> t;
while (t--)
{
string s;
cin >> s;
if (isSubstring(s, "101") || isSubstring(s, "010"))
{
cout << "Tasty" << endl;
}
else
cout << "Tasteless" << endl;
}
return 0;
}
#include
using namespace std;
int main(){
int n;
bool resposta = true;
for(int i=0; i<8; i++){
cin>>n;
if(n >1) resposta = false;
}
if(resposta)
cout<<"S"<< endl;
else
cout<<"F"<
}
#include <iostream>
using namespace std;
int main()
{
int puppies, kitties;
cout<<"Enter the number of puppies: ";
cin>>puppies;
cout<<"Enter the number of kitties: ";
cin>>kitties;
if(puppies <= 1)
cout<<"You have adopted "<<puppies<<" puppy ";
else
cout<<"You have adopted "<<puppies<<" puppies ";
if(kitties <= 1)
cout<<"and "<<kitties<<" kitty";
else
cout<<"and "<<kitties<<" kitties";
return 0;
}