Tag: find occurrences

计数字母发生

程序需要计算并显示指定的charector在文本文件中出现的次数。 目前总数为零。 我不是,如果我应该使用不同的循环,我也尝试使用’for’循环。 // Hold user input and sum String fileName; // Holds the name of the file String letter; // Letter to search for in the file int total = 0; // Holds the total number of characters in the file // Get the name of the file and character from the user fileName […]