Что в коде не так? #include #include #include using namespace std; int main() { string s; vector vowels = ('a','e','i','o','u','y'); cin > > s; int count_letters = 0; int count = 0; int state = -1; int c = state; for(int i = 0 ; i < s.length(); i++, c = state) { if(find(vowels..)! = vowels. state = 0; else state = 1; if(c==state) count_letters++; if(count_letters == 3) { count_letters = 1; count++; } } cout < < count ; } in function 'int main()': conversion from char to non-scalar type requested cin was not declared in this scope cout was not declared in this scope

nikzyryanov02 nikzyryanov02    2   18.08.2019 17:00    0

Ответы
starceva83 starceva83  05.10.2020 03:10
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
string s; 
vector<char> vowels = {'a','e','i','o','u','y'};
cin >> s; 
int count_letters = 0; 
int count = 0; 
int state = -1; 
int c = state; 
for(int i = 0 ;i < s.length(); i++, c = state) {
  if(find(vowels.begin(),vowels.end(),s[i]) != vowels.end()) 
  state = 0;
  else state = 1; 
  if(c==state) count_letters++; 
  if(count_letters == 3) { 
    count_letters = 1;
    count++; 
  }

cout << count ;
}
ПОКАЗАТЬ ОТВЕТЫ
Другие вопросы по теме Информатика