public class Dictionary {
String[] words = {
#for "//word"#
"#"."#",
#end#
};
boolean isWord(String w) {
for (int j=0; j<words.length; ++j) {
if (w.equals(words[j])) {
return true;
}
}
return false;
}
public static void main(String[] args) {
Dictionary d = new Dictionary();
for (int j=0; j<args.length; ++j) {
System.out.println(args[j]
+" is "+(d.isWord(args[j])?"":"not ")
+"in the dictionary.");
}
}
}
|