Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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
";
		else
			cout << "No
";
	}

	return 0;
}
Source by www.codechef.com #
 
PREVIOUS NEXT
Tagged: #Studying #Alphabet #codechef #solution
ADD COMMENT
Topic
Name
2+2 =