Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	string moji;
	int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=0;
	cin >> moji;
	for(int i=0;i<moji.length();i++){
		if(a[i]=='a'||a[i]=='A')a++;
		if(a[i]=='b'||a[i]=='B')b++;
		if(a[i]=='c'||a[i]=='C')c++;
		if(a[i]=='d'||a[i]=='D')d++;
		if(a[i]=='e'||a[i]=='E')e++;
		if(a[i]=='f'||a[i]=='F')f++;
		if(a[i]=='g'||a[i]=='G')g++;
		if(a[i]=='h'||a[i]=='H')h++;
		if(a[i]=='i'||a[i]=='I')i++;
		if(a[i]=='j'||a[i]=='J')j++;
		if(a[i]=='k'||a[i]=='K')k++;
		if(a[i]=='l'||a[i]=='L')l++;
		if(a[i]=='m'||a[i]=='M')m++;
		if(a[i]=='n'||a[i]=='N')n++;
		if(a[i]=='o'||a[i]=='O')o++;
		if(a[i]=='p'||a[i]=='P')p++;
		if(a[i]=='q'||a[i]=='Q')q++;
		if(a[i]=='r'||a[i]=='R')r++;
		if(a[i]=='s'||a[i]=='S')s++;
		if(a[i]=='t'||a[i]=='T')t++;
		if(a[i]=='u'||a[i]=='U')u++;
		if(a[i]=='v'||a[i]=='V')v++;
		if(a[i]=='w'||a[i]=='W')w++;
		if(a[i]=='x'||a[i]=='X')x++;
		if(a[i]=='y'||a[i]=='Y')y++;
		if(a[i]=='z'||a[i]=='Z')z++;
	}
	cout <<"a"<<" : "<<a<<endl;
	cout <<"b"<<" : "<<b<<endl;
	cout <<"c"<<" : "<<c<<endl;
	cout <<"d"<<" : "<<d<<endl;
	cout <<"e"<<" : "<<e<<endl;
	cout <<"f"<<" : "<<f<<endl;
	cout <<"g"<<" : "<<g<<endl;
	cout <<"h"<<" : "<<h<<endl;
	cout <<"i"<<" : "<<i<<endl;
	cout <<"j"<<" : "<<j<<endl;
	cout <<"k"<<" : "<<k<<endl;
	cout <<"l"<<" : "<<l<<endl;
	cout <<"m"<<" : "<<m<<endl;
	cout <<"n"<<" : "<<n<<endl;
	cout <<"p"<<" : "<<o<<endl;
	cout <<"q"<<" : "<<q<<endl;
	cout <<"r"<<" : "<<r<<endl;
	cout <<"s"<<" : "<<s<<endl;
	cout <<"t"<<" : "<<t<<endl;
	cout <<"u"<<" : "<<u<<endl;
	cout <<"v"<<" : "<<v<<endl;
	cout <<"w"<<" : "<<w<<endl;
	cout <<"x"<<" : "<<x<<endl;
	cout <<"y"<<" : "<<y<<endl;
	cout <<"z"<<" : "<<z<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: invalid types 'int[int]' for array subscript
    9 |                 if(a[i]=='a'||a[i]=='A')a++;
      |                     ^
a.cc:9:32: error: invalid types 'int[int]' for array subscript
    9 |                 if(a[i]=='a'||a[i]=='A')a++;
      |                                ^
a.cc:10:21: error: invalid types 'int[int]' for array subscript
   10 |                 if(a[i]=='b'||a[i]=='B')b++;
      |                     ^
a.cc:10:32: error: invalid types 'int[int]' for array subscript
   10 |                 if(a[i]=='b'||a[i]=='B')b++;
      |                                ^
a.cc:11:21: error: invalid types 'int[int]' for array subscript
   11 |                 if(a[i]=='c'||a[i]=='C')c++;
      |                     ^
a.cc:11:32: error: invalid types 'int[int]' for array subscript
   11 |                 if(a[i]=='c'||a[i]=='C')c++;
      |                                ^
a.cc:12:21: error: invalid types 'int[int]' for array subscript
   12 |                 if(a[i]=='d'||a[i]=='D')d++;
      |                     ^
a.cc:12:32: error: invalid types 'int[int]' for array subscript
   12 |                 if(a[i]=='d'||a[i]=='D')d++;
      |                                ^
a.cc:13:21: error: invalid types 'int[int]' for array subscript
   13 |                 if(a[i]=='e'||a[i]=='E')e++;
      |                     ^
a.cc:13:32: error: invalid types 'int[int]' for array subscript
   13 |                 if(a[i]=='e'||a[i]=='E')e++;
      |                                ^
a.cc:14:21: error: invalid types 'int[int]' for array subscript
   14 |                 if(a[i]=='f'||a[i]=='F')f++;
      |                     ^
a.cc:14:32: error: invalid types 'int[int]' for array subscript
   14 |                 if(a[i]=='f'||a[i]=='F')f++;
      |                                ^
a.cc:15:21: error: invalid types 'int[int]' for array subscript
   15 |                 if(a[i]=='g'||a[i]=='G')g++;
      |                     ^
a.cc:15:32: error: invalid types 'int[int]' for array subscript
   15 |                 if(a[i]=='g'||a[i]=='G')g++;
      |                                ^
a.cc:16:21: error: invalid types 'int[int]' for array subscript
   16 |                 if(a[i]=='h'||a[i]=='H')h++;
      |                     ^
a.cc:16:32: error: invalid types 'int[int]' for array subscript
   16 |                 if(a[i]=='h'||a[i]=='H')h++;
      |                                ^
a.cc:17:21: error: invalid types 'int[int]' for array subscript
   17 |                 if(a[i]=='i'||a[i]=='I')i++;
      |                     ^
a.cc:17:32: error: invalid types 'int[int]' for array subscript
   17 |                 if(a[i]=='i'||a[i]=='I')i++;
      |                                ^
a.cc:18:21: error: invalid types 'int[int]' for array subscript
   18 |                 if(a[i]=='j'||a[i]=='J')j++;
      |                     ^
a.cc:18:32: error: invalid types 'int[int]' for array subscript
   18 |                 if(a[i]=='j'||a[i]=='J')j++;
      |                                ^
a.cc:19:21: error: invalid types 'int[int]' for array subscript
   19 |                 if(a[i]=='k'||a[i]=='K')k++;
      |                     ^
a.cc:19:32: error: invalid types 'int[int]' for array subscript
   19 |                 if(a[i]=='k'||a[i]=='K')k++;
      |                                ^
a.cc:20:21: error: invalid types 'int[int]' for array subscript
   20 |                 if(a[i]=='l'||a[i]=='L')l++;
      |                     ^
a.cc:20:32: error: invalid types 'int[int]' for array subscript
   20 |                 if(a[i]=='l'||a[i]=='L')l++;
      |                                ^
a.cc:21:21: error: invalid types 'int[int]' for array subscript
   21 |                 if(a[i]=='m'||a[i]=='M')m++;
      |                     ^
a.cc:21:32: error: invalid types 'int[int]' for array subscript
   21 |                 if(a[i]=='m'||a[i]=='M')m++;
      |                                ^
a.cc:22:21: error: invalid types 'int[int]' for array subscript
   22 |                 if(a[i]=='n'||a[i]=='N')n++;
      |                     ^
a.cc:22:32: error: invalid types 'int[int]' for array subscript
   22 |                 if(a[i]=='n'||a[i]=='N')n++;
      |                                ^
a.cc:23:21: error: invalid types 'int[int]' for array subscript
   23 |                 if(a[i]=='o'||a[i]=='O')o++;
      |                     ^
a.cc:23:32: error: invalid types 'int[int]' for array subscript
   23 |                 if(a[i]=='o'||a[i]=='O')o++;
      |                                ^
a.cc:24:21: error: invalid types 'int[int]' for array subscript
   24 |                 if(a[i]=='p'||a[i]=='P')p++;
      |                     ^
a.cc:24:32: error: invalid types 'int[int]' for array subscript
   24 |                 if(a[i]=='p'||a[i]=='P')p++;
      |                                ^
a.cc:25:21: error: invalid types 'int[int]' for array subscript
   25 |                 if(a[i]=='q'||a[i]=='Q')q++;
      |                     ^
a.cc:25:32: error: invalid types 'int[int]' for array subscript
   25 |                 if(a[i]=='q'||a[i]=='Q')q++;
      |                                ^
a.cc:26:21: error: invalid types 'int[int]' for array subscript
   26 |                 if(a[i]=='r'||a[i]=='R')r++;
      |                     ^
a.cc:26:32: error: invalid types 'int[int]' for array subscript
   26 |                 if(a[i]=='r'||a[i]=='R')r++;
      |                                ^
a.cc:27:21: error: invalid types 'int[int]' for array subscript
   27 |                 if(a[i]=='s'||a[i]=='S')s++;
      |                     ^
a.cc:27:32: error: invalid types 'int[int]' for array subscript
   27 |                 if(a[i]=='s'||a[i]=='S')s++;
      |                                ^
a.cc:28:21: error: invalid types 'int[int]' for array subscript
   28 |                 if(a[i]=='t'||a[i]=='T')t++;
      |                     ^
a.cc:28:32: error: invalid types 'int[int]' for array subscript
   28 |                 if(a[i]=='t'||a[i]=='T')t++;
      |                                ^
a.cc:29:21: error: invalid types 'int[int]' for array subscript
   29 |                 if(a[i]=='u'||a[i]=='U')u++;
      |                     ^
a.cc:29:32: error: invalid types 'int[int]' for array subscript
   29 |                 if(a[i]=='u'||a[i]=='U')u++;
      |                                ^
a.cc:30:21: error: invalid types 'int[int]' for array subscript
   30 |                 if(a[i]=='v'||a[i]=='V')v++;
      |                     ^
a.cc:30:32: error: invalid types 'int[int]' for array subscript
   30 |                 if(a[i]=='v'||a[i]=='V')v++;
      |                                ^
a.cc:31:21: error: invalid types 'int[int]' for array subscript
   31 |                 if(a[i]=='w'||a[i]=='W')w++;
      |                     ^
a.cc:31:32: error: invalid types 'int[int]' for array subscript
   31 |                 if(a[i]=='w'||a[i]=='W')w++;
      |                                ^
a.cc:32:21: error: invalid types 'int[int]' for array subscript
   32 |                 if(a[i]=='x'||a[i]=='X')x++;
      |                     ^
a.cc:32:32: error: invalid types 'int[int]' for array subscript
   32 |                 if(a[i]=='x'||a[i]=='X')x++;
      |                                ^
a.cc:33:21: error: invalid types 'int[int]' for array subscript
   33 |                 if(a[i]=='y'||a[i]=='Y')y++;
      |                     ^
a.cc:33:32: error: invalid types 'int[int]' for array subscript
   33 |                 if(a[i]=='y'||a[i]=='Y')y++;
      |                                ^
a.cc:34:21: error: invalid types 'int[int]' for array subscript
   34 |                 if(a[i]=='z'||a[i]=='Z')z++;
      |                     ^
a.cc:34:32: error: invalid types 'int[int]' for array subscript
   34 |                 if(a[i]=='z'||a[i]=='Z')z++;
      |                                ^