OJ平台作业:1.9-06:笨小猴
#include
using namespace std;
int main()
{
int max = 0, min = 100, d = 0, i = 0, j = 0, k = 0;
char x = '?';
char str[100];
cin.get(str, 100);
for (i = 0; x != '/0'; i++)
{
x = str[i];
}
j = i;
for (i = 0; i < j - 1; i++)
{
x = str[i];
for (k = 0; k < j - 1; k++)
{
if (x == str[k])
{
d++;
if (d > max)
{
max = d;
}
if (d < min)
{
min = d;
}
}
}
d = 0;
}
d = max - min;
k = 2;
for (; k < d; k++)
共有 0 条评论