Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- class CodeOfEthics
- {
- static void Main( )
- {
- StreamReader inStream = null;
- string filename = "codeofethics.txt";
- int counter = 0;
- string line;
- inStream = new StreamReader( filename );
- do
- {
- line = inStream.ReadLine( );
- line.ToLower();
- foreach(char c in line)
- {
- if(c == 'a')
- {
- counter++;
- }
- }
- }while(counter != -1);
- Console.WriteLine(counter);
- inStream.Close();
- }
- }
Add Comment
Please, Sign In to add comment