рай35
14.04.2023 04:49

Выполнить при алгоритма
с постусловием. в виде блок-схемы.

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
xgvhhdhs
18.10.2020 18:46

var G,F:file of integer;

   i,j,n:integer;

   s:integer;

   c,c1,c2:integer;

begin

writeln;

write('Vvedite n:');

readln(n);

Assign(G,'C:\g.txt');

Assign(F,'C:\f.txt');

Rewrite(F);

for i:=1 to n do

begin

c1:=1;

c2:=1;

for j:=1 to i+1 do begin

if j<i+1 then c1:=c1*2;

c2:=c2*3;

end;

c:=c1+c2;

write(F,c);

end;

Close(F);

Reset(F);

Rewrite(G);

s:=0;

while not Eof(f) do

begin

read(F,c);

if c>0 then c:=c*(-1);

write(G,c);

s:=s+c;

end;

write(G,s);

close(F);

close(G);

reset(G);

writeln('Komponenty fajla j:');

while not Eof(G) do

begin

read(G,c);

write(c);

end;

readln;

end.

Приклад.Виведення таблиці значень функції у файл.

Програма:

program file_of_values;

var

х : Real;

k : Word;

out_file : Text; {тип Text відповідає файлу. що складається із рядків тексту}

function F(x: Real): Real;  

begin

F := x/d.O + x);  

end;

begin

Assign(out_file, 'c:\user\ivanov\table.dat');

Rewrite(out_file);

x := 0.0;

WriteLn(out_file, 'Таблиця значень функції F(x) = x/(l + x)');

WriteLn(out_file);

WriteLn(out_file, 'x':9, 'F(x)':19);

WriteLn(out_file);

for k := 0 to 50 do  

begin

WriteLn(out_file, x:9:3, F(x):19:9);

x := x + 0.1:

if k mod 10 = 9 then WriteLn(out_file);  

end;

Close(out_file);  

end.

0,0(0 оценок)
Ответ:
svetaabc
24.05.2022 18:18

#include <bits/stdc++.h>

using namespace std;

int main() {

   char a,b,r,p,s;

   cin>>a>>b;

   if(a==p and b==p){

       cout<<p;

   }else if(a==r and b==r){

       cout<<r;

   }else if(a==s and b==s){

       cout<<s;

   }else if(a==p and b==r){

       cout<<s;

   }else if(a==r and b==p){

       cout<<s;

   }else if(a==s and b==r){

       cout<<p;

   }else if(a==r and b==s){

       cout<<p;

   }else if(a==p and b==s){

       cout<<r;

   }else if(a==s and b==p){

       cout<<r;

   }

   return 0;

}

Объяснение:

у меня там ошибка, не могу понять из за чего

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота