Ответ:
#include <iostream>
int main()
{
const char* str = "-+qwert-+4aa1546-+awdwads-+";
unsigned count = 0u;
while(*str++)
if (*str == '+' && *(str - 1u) == '-')
count++;
}
std::cout << "Count = " << count << std::endl;
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
#include <iostream>
int main()
{
const char* str = "-+qwert-+4aa1546-+awdwads-+";
unsigned count = 0u;
while(*str++)
{
if (*str == '+' && *(str - 1u) == '-')
count++;
}
std::cout << "Count = " << count << std::endl;
}