You are viewing a single comment's thread. Return to all comments →
we can directly compare the alphabets with their ASCII code values
int main() { string s; getline(cin,s);
int a_=96,A_=64; int totalCount=0; int alpCount=0; int size=s.size();
for(int j=0;j<26;j++) { alpCount=0; a_++; A_++;
for(int i=0;i<size;i++) { if(s[i]==a_|| s[i]==A_) { alpCount++; } } if(alpCount>=1) { totalCount++; } } if(totalCount==26) cout<<"pangram"; else cout<<"not pangram"; return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Pangrams
You are viewing a single comment's thread. Return to all comments →
we can directly compare the alphabets with their ASCII code values
int main() { string s; getline(cin,s);
for(int j=0;j<26;j++) { alpCount=0; a_++; A_++;
}