本文整理汇总了C#中Analyzer.Count方法的典型用法代码示例。如果您正苦于以下问题:C# Analyzer.Count方法的具体用法?C# Analyzer.Count怎么用?C# Analyzer.Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analyzer
的用法示例。
在下文中一共展示了Analyzer.Count方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
string inputname = args[0];
string outputname = args[1];
string[] lines = File.ReadAllLines(inputname);
int ncases = int.Parse(lines[0]);
int nline = 0;
IList<string> results = new List<string>();
Analyzer analyzer = new Analyzer();
for (int k = 0; k < ncases; k++)
{
Console.WriteLine(string.Format("Solving Case #{0}", k + 1));
nline++;
string[] words = lines[nline].Split(' ');
string text = words[0];
int length = int.Parse(words[1]);
int count = analyzer.Count(text, length);
results.Add(string.Format("Case #{0}: {1}", k + 1, count));
}
File.WriteAllLines(outputname, results.ToArray());
}
示例2: GetCountGcjLength2
public void GetCountGcjLength2()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(3, analyzer.Count("gcj", 2));
}
示例3: GetCountQuartzLength2
public void GetCountQuartzLength2()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(9, analyzer.Count("quartz", 2));
}
示例4: GetCountAbeLength1
public void GetCountAbeLength1()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(4, analyzer.Count("abe", 1));
}
示例5: GetCountAaaaLength3
public void GetCountAaaaLength3()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(0, analyzer.Count("aaaa", 3));
}
示例6: GetCountTsetseLength2
public void GetCountTsetseLength2()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(11, analyzer.Count("tsetse", 2));
}
示例7: GetCountStringLength3
public void GetCountStringLength3()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(4, analyzer.Count("string", 3));
}
示例8: GetCountStraightLength3
public void GetCountStraightLength3()
{
Analyzer analyzer = new Analyzer();
Assert.AreEqual(11, analyzer.Count("straight", 3));
}