Advertisement
JuliaPopadowska

zad 7/10 PN

May 14th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1.     int tab[26] = { 0 }, suma = 0;
  2.     float tab1[26];
  3.     char cc=NULL;
  4.     FILE *plik;
  5.     fopen_s(&plik, "Eden.txt", "r");
  6.     cc = fgetc(plik);
  7.     while (feof(plik) == 0)
  8.     {
  9.         if (cc >= 'a' && cc <= 'z') {
  10.             tab[cc - 'a']++;
  11.             suma++;
  12.         }
  13.         cc = fgetc(plik);
  14.     }
  15.    
  16.     for (int i = 0; i < 26; i++) printf_s("%d,%f \n", tab[i],tab1[i]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement