Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
frequsency
#include <bits/stdc++.h> using namespace std; int main() { int k; char str[400]; cout<<"Enter the sentence:- "<<endl; for(k=0;k<400;k++) {cin>>str[k];} int i=0; int alphabate[26]={};int alphabate2[26]={}; int j,m; while(str[i]!='\0') { if(str[i]>='a' and str[i]<='z') { j=str[i]-'a'; ++alphabate[j]; } if(str[i]>='A' and str[i]<='Z') { m=str[i]-'A'; ++alphabate2[m]; } ++i; } cout<<"Frequency: "<<endl; for(i=0;i<26;i++) { cout<<char(i+'a')<<":"<<alphabate[i]<<" "<<char(i+'A')<<":"<<alphabate2[i]<<endl; } return 0; }
run
|
edit
|
history
|
help
1
Default_Template
DSU on tree (http://codeforces.com/contest/600/problem/E)
ONP
remove_if_30-Seconds-of-C++
Easy String Reverse Example
anagram
Logical AND versus Bitwise AND
პირამიდის პერიმეტრი.ფინალური
Ballin primality test
HashRK