Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.util.Scanner;
- public class kolodL2_B {
- public static void main(String[] args) throws FileNotFoundException {
- File inFile = new File("B.dat");
- Scanner sc = new Scanner(inFile);
- int suma = 0;
- while(sc.hasNext()) {
- String data = sc.nextLine();
- if(data.contains("!")) {
- suma += 1;
- }
- }
- System.out.println("Linii z wykrzyknikami jest: "+ suma);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement