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

4. Рассмотрите алгоритм и заполните таблицу трассировки. S = 0

for i in range (3 , 11) s i

if i % 2 = = 0 :

4 4

S = S + i

print ( S, i )


4. Рассмотрите алгоритм и заполните таблицу трассировки. S = 0 for i in range (3 , 11) s i if i % 2

👇
Открыть все ответы
Ответ:
kotsdanil778
kotsdanil778
02.04.2022

#include <iostream> // header input/output streams

#include <fstream> // header для работы с файлами

using std::ifstream; // для работы с файлом input.txt

using std::ofstream; // для работы с файлом output.txt

using std::cin; // для работы cin

using std::cout; // для работы cout

using std::endl; // для работы перевода на новую строку endl

int main(){

ifstream in_file;  // input.txt

  ofstream out_file;  //output.txt

   try{

     in_file.open("input.txt");

     out_file.open("output.txt");

   }

  catch(std::exception& e){

     cout << e.what() << endl;

   }

  unsigned int a,b;

  in_file >> a >> b;

  unsigned int sum = a+b -1;

cout << sum;

  out_file << sum - a << ' ' << sum-b << endl;

}

4,6(96 оценок)
Ответ:
stetcenko87
stetcenko87
02.04.2022

#include <iostream> // header input/output streams

#include <fstream> // header для работы с файлами

using std::ifstream; // для работы с файлом input.txt

using std::ofstream; // для работы с файлом output.txt

using std::cin; // для работы cin

using std::cout; // для работы cout

using std::endl; // для работы перевода на новую строку endl

int main(){

ifstream in_file;

  ofstream out_file;

   try{

     in_file.open("input.txt");

     out_file.open("output.txt");

   }

  catch(std::exception& e){

     cout << e.what() << endl;

   }

  unsigned int a,b;

  in_file >> a >> b;

  unsigned int sum = a+b -1;

cout << sum;

  out_file << sum - a << ' ' << sum-b << endl;

}

4,6(47 оценок)
Новые ответы от MOGZ: Информатика
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ