Home > Back-end >  QWQ great god answer
QWQ great god answer

Time:09-18

# include & lt; Iostream>
# include & lt; Cstdio>
# include & lt; Cstdlib>
using namespace std;
Int main ()
{
Int n, m;
Cin> n;
Char a, [10000].
Cin> a;
Int a1=0, a2=0, a3=0;
For (m=0; M<=n - 1; M++)
{
If (a [m]=='a' & amp; & A [m]=='a')
A1=a1 + 1;
If (a [m]=='b' & amp; & A [m]=='B')
A2=a2 + 1;
If (a [m]=='a' & amp; & A [m]=='C')
A3=a3 + 1;
}
Cout<" A "& lt; Cout<" B "& lt; Cout<" C "& lt; getchar();
Return 0;
}

Topic: ABC three people, n individual vote (n) needed for input, statistics of ABC three votes, ABC three letters outside characters for waiver, according to the number of votes to print candidates and vote (same count of votes in alphabetical order according to the ABC output)
Input details:
The first line n for someone vote

The second line have n characters (letters don't difference between case, such as a and a representative for a ticket, the characters of ABC outside waiver)

Output:
Three lines of each row of the first letter (only for one of ABC, and then vote), from big to small order
Input the sample: help

6
AbcA1b
The output sample:

A 2
2 b
C 1

Is there a problem?
  • Related