Studying Alphabet

#include <bits/stdc++.h> using namespace std; int main () { int x,ll=0; string know; sort(know.begin(),know.end()); cin>>know; cin >> x; for (int i = 0; i < x; i++) { string z; cin>>z; for(int j=0;j<z.length();j++){ ll=0; for(int k=0;k<know.length();k++){ if(z[j]==know[k]) {ll=1; break; }} if(ll==0) break; } if(ll==1) cout<<"Yes"<<endl; else cout<<"No"<<endl; } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.