Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- #include<ostream>
- #include<stdio.h>
- #include<string>
- using namespace std;
- void main() {
- setlocale(LC_ALL, "rus");
- ofstream fileA("me.txt");
- char ib[50];
- cout << "Введите строку:" << endl;
- gets_s(ib);
- fileA << ib;
- fileA.close();
- ifstream fileB("me.txt");
- string lab;
- int skob = 0;
- getline(fileB, lab);
- cout << lab;
- int i = 0;
- while (i<lab.length())
- {
- if (lab[i] == '(' || lab[i] == ')') skob++;
- i++;
- }
- cout << endl << "количество скобок:" << skob;
- fileB.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement