М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации
sannikova04
sannikova04
11.01.2020 02:41 •  Информатика

Что в коде не так? #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

👇
Ответ:
RomansPirs
RomansPirs
11.01.2020
#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 ;
}
4,8(20 оценок)
Открыть все ответы
Ответ:
// PascalABC.NET 3.0, сборка 1073
const
  m=5;
  n=4;
  a:array[1..m] of real=(2,-7.1,3.2,-5.4,6.9);
  b:array[1..n] of real=(8.1,3.2,-6.4,-3.5);
  k=3;
var
  i,j:integer;
  sk:real;
  s:array[1..m,1..n] of real;
begin
  Writeln('Массив S');
  for i:=1 to m do begin
    for j:=1 to n do begin
      s[i,j]:=a[i]*b[j];
      Write(s[i,j]:7:2)
    end;
    Writeln
  end;
  sk:=0;
  for i:=1 to m do sk:=sk+s[i,k];
  Writeln('Сумма элементов столбца ',k,' равна ',sk)
end.

Результат выполнения программы:
Массив S
  16.20   6.40 -12.80  -7.00
 -57.51 -22.72  45.44  24.85
  25.92  10.24 -20.48 -11.20
 -43.74 -17.28  34.56  18.90
  55.89  22.08 -44.16 -24.15
Сумма элементов столбца 3 равна 2.56
4,5(72 оценок)
Ответ:
NoxchiKent
NoxchiKent
11.01.2020
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;

int main(){
srand(time(0));
int n,m;
cin>>n;
cin>>m;
int **a=new int *[m];
for(int i=0;i<m;i++)
  a[i]=new int[n];
    cout<<"Matrix A:";
      for(int i=0;i<m;i++){
        cout<<"\n";
           for(int j=0;j<n;j++){
                 a[i][j]=rand()%17-7;
                     cout<<a[i][j]<<" ";
}
}
int *b = new int[m];
cout<<"\n Array B:";
for(int j=0;j<n;j++){
b[j]=0;
 for(int i=0;i<m;i++){
   b[j]=b[j]+a[i][j];
     }cout<<b[j]<<" ";
   }
cin.get();
cin.get();
return 0;
}
Блок-схема и программка на с++ получить матрицу а размера , заполненную случайными числами от -7 до
4,8(70 оценок)
Это интересно:
Новые ответы от MOGZ: Информатика
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ