日期:2014-05-17 浏览次数:21095 次
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
public class Test
{
public static long howmany(string s)
{
char[] charList = s.ToCharArray();
List<int> b = new List<int>();
List<int> i = new List<int>();
List<int> n = new List<int>();
List<int> g = new List<int>();
for (int j = 0; j < charList.Length; j++)
{
if (charList[j] == 'b')
b.Add(j + 1);
else if (charList[j] == 'i')
i.Add(j + 1);
else if (charList[j] == 'n')
n.Add(j + 1);
else if (charList[j] == 'g')
g.Add(j + 1);
}
long count = 0;
for (int j = 0; j < b.Count; j++)
{
for (int k = 0; k < i.Count; k++)
{
if (i[k] > b[j])
{
for (int m = 0; m < n.Count; m++)
{
if (n[m] > i[k])
{
for (int t =