Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- namespace Application
- {
- public class Apr9 // DailyProgrammer, Apr. 9th
- {
- public static int lines;
- public static int words;
- public static string filename;
- static public int Main (string[] args)
- {
- filename = args[0];
- lines = File.ReadAllLines(filename).Length;
- foreach(string s in File.ReadAllLines (filename))
- {
- //
- string[] split = s.Split(" ".ToCharArray());
- words += split.Length;
- }
- Console.WriteLine(lines);
- Console.WriteLine(words);
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement