Using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace zn { class Program { public static void Main(string[] args) { Console.Write("Введите кол-во минут по тарифу: "); int a = Convert.ToInt32(Console.ReadLine()); Console.Write("Введите цену за минуту по тарифу: "); int b = Convert.ToInt32(Console.ReadLine()); Console.Write("Введите цену за минуту сверх тарифа: "); int c = Convert.ToInt32(Console.ReadLine()); Console.Write("Введите время пользования услугами связи за месяц в минутах: "); int d = Convert.ToInt32(Console.ReadLine()); int res = a > d ? a * b : a * b + (d - a) * c; Console.WriteLine("Плата за пользование: " + res); Console.ReadKey(); } } }
// PascalABC.NET 3.0, сборка 1073 const nn=30; mm=30; var a:array[1..mm,1..nn] of integer; m,n,i,j,imax,imin,jmax,jmin:integer; begin Writeln('Введите число строк и столбцов массива: '); Read(m,n); Randomize; Writeln('*** Исходный массив ***'); imin:=1; jmin:=1; imax:=1; jmax:=1; for i:=1 to m do begin for j:=1 to n do begin a[i,j]:=Random(51)-25; Write(a[i,j]:4); if a[i,j] mod 2 = 0 then begin if a[i,j]<a[imin,jmin] then begin imin:=i; jmin:=j end else if a[i,j]>a[imax,jmax] then begin imax:=i; jmax:=j end end end; Writeln end; Writeln('*** Результирующий массив ***'); for i:=1 to m do begin for j:=1 to n do begin if (i=imin) and (j=jmin) or (i=imax) and (j=jmax) then a[i,j]:=2*a[i,j] else a[i,j]:=3*a[i,j]; Write(a[i,j]:4) end; Writeln end end.
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace zn
{
class Program
{
public static void Main(string[] args)
{
Console.Write("Введите кол-во минут по тарифу: ");
int a = Convert.ToInt32(Console.ReadLine());
Console.Write("Введите цену за минуту по тарифу: ");
int b = Convert.ToInt32(Console.ReadLine());
Console.Write("Введите цену за минуту сверх тарифа: ");
int c = Convert.ToInt32(Console.ReadLine());
Console.Write("Введите время пользования услугами связи за месяц в минутах: ");
int d = Convert.ToInt32(Console.ReadLine());
int res = a > d ? a * b : a * b + (d - a) * c;
Console.WriteLine("Плата за пользование: " + res);
Console.ReadKey();
}
}
}