dianadiana1982
20.03.2020 20:47

Как умножить матрицу на число в питоне? напишите программу, желательно с пояснениями

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Monimix
22.10.2020 17:58

Объяснение:

#include<iostream>

#include<math.h>

using namespace std;

Int main()

{

Double ch,min,sec,ch1,min1,sec1,ch2,min2,sec2,minut;

setlocale (LC_ALL, " rus");

cout<<"Введите время начала разговора ch1, min1, sec1 " << "\n";

cin>>ch>>min>>sec;

Cout<<"Введите врямя конца разговора ch2 ,min2, sec2 "<<"\n";

cin>> ch2>>min2>>sec2;

ch=ch2-ch1;

min=min2-min1;

sec=sec2-sec1;

min=ch*60+min+(sec/60);

minut=min*30;

Cout<<"Стоимость разговора = "<<minut<< " копеек "

return 0;

}

0,0(0 оценок)
Ответ:
Pomogashka2002
23.05.2022 04:47

xD

uses crt;

var

dt,t1,t2:LongInt;

function GetTime:LongInt;

var

substr,str:string;

ERR,step,spacepos,code,num:Integer;

t:longint;

begin

ERR:=0;

repeat

t:=0;

step:=1;

if ERR<>0 then writeln('Nepravilnie dannie, povtorite vvod:');

ERR:=0;

readln(str);

str:=str+' ';

repeat

spacepos:=pos(' ',str);

if (spacepos<>0) then

begin

substr:=copy(str,1,spacepos-1);

delete(str,1,spacepos);

val(substr,num,code);

if code=0 then

begin

if (step=1) then begin if (num>=0) and (num<=23) then t:=t+num*60*60 else ERR:=3; end;

if (step=2) then begin if (num>=0) and (num<=59) then t:=t+num*60 else ERR:=3;end;

if (step=3) then begin if (num>=0) and (num<=59) then t:=t+num else ERR:=3;end;

inc(step);

end

else ERR:=2;

end else ERR:=1;

until ((step=4) or (err<>0));

until err=0;

GetTime:=t;

end;

begin

writeln('pervoe vremy:');

t1:=GetTime;

writeln('vtoroe vremy:');

t2:=GetTime;

if t2>=t1 then dt:=t2-t1 else dt:=t2-t1+24*60*60;

writeln('raznica v sekundah: ');

writeln(dt);

end.

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