fork download
  1. #include <stdio.h>
  2. int vowels = 0, consonants = 0;
  3.  
  4. %%
  5. [aeiouAEIOU] { vowels++; }
  6. [b-df-hj-np-tv-zB-DF-HJ-NP-TV-Z] { consonants++; }
  7. .|\n
  8. %%
  9.  
  10. int main() {
  11. yylex(); // Start Lex analysis
  12. printf("Vowels: %d\n", vowels);
  13. printf("Consonants: %d\n", consonants);
  14. return 0;
  15. }
  16.  
  17.  
Success #stdin #stdout #stderr 0.03s 6920KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/HXG6lq/prog:16:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit