А как сюда добавиться ввод с клавиатуры
C++ |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| #include <iostream>
int main(int argc, char *argv[])
{
std::string str = "foo bar(lol)lorem ipsum dolor";
size_t count = 0;
for ( std::string::iterator it=str.begin(); it!=str.end(); ++it)
if(*it == '(')
while(*++it != ')')
++count;
std::cout << count << std::endl;
return 0;
} |
|