Answers for "Studying Alphabet codechef solution in c++"

C++
0

Studying Alphabet codechef solution in c++

#include<iostream>
using namespace std;

int main()
{
    
	string s;
	cin >> s;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		string le;
		cin >> le;
		int count = 0;
		for (int j = 0; j < s.length(); j++)
		{
			for (int k = 0; k < le.length(); k++)
			{
				if (s[j] == le[k])
					count++;
			}
		}
		if (count==le.size())
			cout << "Yes\n";
		else
			cout << "No\n";
	}

	return 0;
}
Posted by: Guest on March-20-2022
0

Studying Alphabet codechef solution in c++

#include<iostream>
using namespace std;

int main()
{
    
	string s;
	cin >> s;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		string le;
		cin >> le;
		int count = 0;
		for (int j = 0; j < s.length(); j++)
		{
			for (int k = 0; k < le.length(); k++)
			{
				if (s[j] == le[k])
					count++;
			}
		}
		if (count==le.size())
			cout << "Yes\n";
		else
			cout << "No\n";
	}

	return 0;
}
Posted by: Guest on March-20-2022

Code answers related to "Studying Alphabet codechef solution in c++"

Browse Popular Code Answers by Language