var s:string; a:array['a'..'z'] of longint; i,t:longint; c:char; begin readln(s); for i:=1 to length(s) do if s[i] in ['a'..'z'] then inc(a[s[i]]); for c:='a' to 'z' do if a[c]>0 then begin t:=t+1; if t=1 then write(c,':',a[c]) else if t mod 5=1 then begin writeln; write(c,':',a[c]); end else write(' ',c,':',a[c]); end; writeln; end.
#include<stdio.h> int main(){ char s[1000],c; int f[300]={0},i,k; gets(s); for(i=0;s[i];i++)f[s[i]]++; for(k=0,c='a';c<='z';c++) if(f[c]){ k++; if(k%5==1)printf("%c:%d",c,f[c]); else printf(" %c:%d",c,f[c]); if(k%5==0)printf("\n"); } if(k%5)printf("\n"); return 0; }