Advertisement
Andites

ОИБ 2 лаба

Nov 1st, 2022
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.  
  10. setlocale(LC_ALL, "Russian");
  11. ifstream origin;
  12. origin.open("origin.txt", ios_base::in);
  13.  
  14. char def[]="ОЕАНИТСЛРВКУПДМЯЫЗЬГБЧЖЙХШЮЩЭЦФЪЁ";
  15. char deflow[]="оеанитслрвкупдмяызьгбчжйхшющэцфъё";
  16. char newdef[]="ОЕАНИТСЛРВКУПДМЯЫЗЬГБЧЖЙХШЮЩЭЦФЪЁ";
  17. int A[33];
  18. for(int i=0;i<33;i++){
  19. A[i]=0;
  20. }
  21.  
  22. char r;
  23. while(!origin.eof()){
  24. origin >> r;
  25. for(int i=0;i<33;i++){
  26. if(r==deflow[i]){
  27. cout << r;
  28. A[i]++;
  29. }
  30. }
  31. }
  32.  
  33. for(int i=0;i<33;i++){
  34. cout << i << " " << A[i] << endl;
  35. }
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement