Skip to content

Instantly share code, notes, and snippets.

@modos
Created March 31, 2021 21:26
Show Gist options
  • Save modos/221ac6f7940fae8329af3d3eb6e46939 to your computer and use it in GitHub Desktop.
Save modos/221ac6f7940fae8329af3d3eb6e46939 to your computer and use it in GitHub Desktop.
آسمان شکر آباد
import java.util.Scanner;
/**
* Main
*/
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int m = input.nextInt();
String[] a = new String[m];
int count = 0;
for (int i = 0; i < n; i++) {
a = input.next().split("");
for (int j = 0; j < m; j++) {
if(a[j].equals("*")){
count++;
}
}
}
System.out.println(count);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment