Skip to content

Instantly share code, notes, and snippets.

@ihopeudie
Created August 29, 2017 13:32
Show Gist options
  • Save ihopeudie/c11a9e00b7ff0eebe5c2c2ba50391c26 to your computer and use it in GitHub Desktop.
Save ihopeudie/c11a9e00b7ff0eebe5c2c2ba50391c26 to your computer and use it in GitHub Desktop.
package com.javarush.task.task18.task1816;
/*
Английские буквы javarush
*/
import java.io.FileInputStream;
import java.io.IOException;
public class Solution {
public static void main(String[] args) throws IOException {
FileInputStream iStream = new FileInputStream(args[0]);
byte[] array = new byte[iStream.available()];
int counter = 0;
iStream.read(array);
for (byte element: array
) {
if ((element>='a') & (element<='z') | (element>='A') & (element <='Z')) counter++;
}
iStream.close();
System.out.println(counter);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment