查词典(查一个词后面的东西)

xiaoxiao2021-02-28  102

open(In,"dict.txt"); while(<In>){ chomp; if(/(.+)=>(.+)/){ $hash{$1}=$2; } } close(In); while(1){ print "plese input a word:\n"; $input=<stdin>; chomp($input); if(defined $hash{$input}){ print "translation:\n$hash{$input}\n"; } else{ print "not found!\n" } }
转载请注明原文地址: https://www.6miu.com/read-83419.html

最新回复(0)