Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3. #include<ostream>
  4. #include<stdio.h>
  5. #include<string>
  6. using namespace std;
  7. void main() {
  8.     setlocale(LC_ALL, "rus");
  9.     ofstream fileA("me.txt");
  10.     char ib[50];
  11.     cout << "Введите строку:" << endl;
  12.     gets_s(ib);
  13.     fileA << ib;
  14.     fileA.close();
  15.     ifstream fileB("me.txt");
  16.     string lab;
  17.     int skob = 0;
  18.     getline(fileB, lab);
  19.     cout << lab;
  20.     int i = 0;
  21.     while (i<lab.length())
  22.     {
  23.         if (lab[i] == '(' || lab[i] == ')') skob++;
  24.         i++;
  25.     }
  26.     cout << endl << "количество скобок:" << skob;
  27.     fileB.close();
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement