Dim s As Integer, d As Date, h As Integer d = CDate(InputBox("Введите дата начала графика", , "2016/01/02")) Do While s < 176 h = Weekday(d, vbMonday) If h <> 7 Then s = s + 8 Cells(i + 1, 2) = s Cells(i + 1, 3) = d End If Cells(i + 1, 4) = h i = i + 1 d = d + 1 Loop
Const nx=30;var i,j,p,n:integer;A:array[1..nx,1..nx] of integer;d,Sn,min:real;begin p:=1;write('Введите размер матрицы');Read(n);for i:=1 to n do beginfor j:=1 to n do beginA[i,j]:=random(3)-2;write(A[i,j]:4);end;writeln;end;writeln;writeln;for i:=1 to n do beginfor j:=1 to n do beginif i = j then begin if A[i,j]<> 0 then p:=p* A[i,j];write(A[i,j]:4);endelse write(' ':4);end;writeln;end;write('p =',p);writeln;writeln;for i:=1 to n do beginfor j:=1 to n do beginif (i= n -j +1) then begin if A[i,j]<> 0 then p:=p* A[i,j];write(A[i,j]:4);endelse write(' ':4);end;writeln;end;write('p =',p);end.
Добрый день! К сожалению я не работаю с C++, но если это то вот эта задача в Pascal VAR a,b,c,d:REAL; PROCEDURE Print_S(x,y,z:REAL); VAR p,S:REAL; begin If ((x+y)>z) and ((x+z)>y) and ((y+z)>x) then begin p:=x+y+z; S:=SQRT(p*(p-x)*(p-y)*(p-z)); WriteLn('S= ',S); end else Writeln('Треугольник не существует!'); end; BEGIN Write('a= '); ReadLn(a); Write('b= '); ReadLn(b); Write('c= '); ReadLn(c); Write('d= '); ReadLn(d); WriteLn; WriteLn('Стороны ',a,'; ',b,'; ',c); Print_S(a,b,c); WriteLn; WriteLn('Стороны ',a,'; ',b,'; ',d); Print_S(a,b,d); WriteLn; WriteLn('Стороны ',a,'; ',c,'; ',d); Print_S(a,c,d); WriteLn; WriteLn('Стороны ',b,'; ',c,'; ',d); Print_S(b,c,d); END.
d = CDate(InputBox("Введите дата начала графика", , "2016/01/02"))
Do While s < 176
h = Weekday(d, vbMonday)
If h <> 7 Then
s = s + 8
Cells(i + 1, 2) = s
Cells(i + 1, 3) = d
End If
Cells(i + 1, 4) = h
i = i + 1
d = d + 1
Loop