Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
18
Task/Pangram-checker/Java/pangram-checker.java
Normal file
18
Task/Pangram-checker/Java/pangram-checker.java
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
public class Pangram {
|
||||
public static boolean isPangram(String test){
|
||||
for (char a = 'A'; a <= 'Z'; a++)
|
||||
if ((test.indexOf(a) < 0) && (test.indexOf((char)(a + 32)) < 0))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
System.out.println(isPangram("the quick brown fox jumps over the lazy dog"));//true
|
||||
System.out.println(isPangram("the quick brown fox jumped over the lazy dog"));//false, no s
|
||||
System.out.println(isPangram("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));//true
|
||||
System.out.println(isPangram("ABCDEFGHIJKLMNOPQSTUVWXYZ"));//false, no r
|
||||
System.out.println(isPangram("ABCDEFGHIJKL.NOPQRSTUVWXYZ"));//false, no m
|
||||
System.out.println(isPangram("ABC.D.E.FGHI*J/KL-M+NO*PQ R\nSTUVWXYZ"));//true
|
||||
System.out.println(isPangram(""));//false
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue