プログラム

From 行でスパムかどうか判定するルーチン。わりと正解率高し。 int is_spam(char *from) { char *ptr = strchr(from, '@'); int dot_count=0; if(!ptr) return 0; ptr++; for(;*ptr && *ptr!=' '; ptr++) { if(*ptr=='.') dot_count++; } if(dot_count==1) …