Facebook
From Morose Marten, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 200
  1. %{
  2. #include <string.h>
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. int liczbaJedynek = 0;
  6. int liczbaZer = 0;
  7.  
  8. %}
  9. %%
  10. 0 {
  11.         liczbaZer++;
  12. }
  13. 1 {
  14.         liczbaJedynek++;
  15. }
  16. %%
  17. int yywrap() {
  18.         if(liczbaJedynek == liczbaZer) printf("Tyle samo 1 i 0");
  19.         else printf("Ciag ma rozna ilosc zer i jedynek");
  20.         return 1;
  21. }
  22. int main() {
  23.         yylex();
  24. }