AMR89154331531
?>

Перевести из языка Си++ в Паскаль #include #include #include #include #include using namespace std; int main(){ srand(time(NULL)); int n; cin»n; int mass[n][n]; int mass1[n][n]; for(int i=0; i for(int j=0; j mass[i][j]=rand()%10*pow(-1, rand()%2); cout«setw(4)«mass[i][j]«' '; } cout«endl; } cout«endl; for(int i=0;i for(int j=0; j mass1[j][n-1-i]=mass[i][j]; } } for(int i=0; i for(int j=0; j cout«setw(4)«mass1[i][j]; if(mass1[i][j]>0){ mass1[i][j]=1; } } cout«endl; } cout«endl; for(int i=0; i for(int j=0; j cout«setw(4)«mass1[i][j]; } cout«endl; } return 0; }

Информатика

Ответы

Andreevna_Grebenshchikova155

// PascalABC.NET 3.6

begin

 var n:= ReadInteger;

 var a := MatrRandom(n, n, -99, 99);

 var b := new integer[n,n];

 a.Println;

 Writeln;

 for var i := 0 to n-1 do

   b.SetCol(n - i - 1, a.Row(i));

 b.Transform(t -> t > 0 ? 1 : t);

 a := b;

 a.Println

end.


Перевести из языка Си++ в Паскаль #include #include #include #include #include using namespace std;
emik071089
Первое:
Для хранения на один пиксель 1 цвет из 65536 цветов достаточно 2^16=65536 - 16 Бит информации или 2 Байта. Изображение имеет 640*350 = 224 000 пикселей. Одно изображение требует для хранения 224 000*2 = 448 000 Байт информации. Следовательно для хранения 2 страниц нужно 448 000*2/1024 = 875 КБайт

Второе:
По формуле 
где D – частота дискретизации (Гц), T – время звучания или записи звука, I - разрядность регистра (разрешение), n - количество каналов.

D = 44100 (Гц)
T = 2*60 = 120 (cек)
I = 16 (бит)
n = 2 - стерео

A=44100*120*16*2=169344000 Бит
 
или 169 344 000/8 = 21 168 000 Байт/1024*1024 = 20,18 Мбайт
Yuliya Aleksandr686
Dim N As Long, M As Long, A As Integer
Dim strN1 As String, LngN1 As Long, i As Integer
Randomize
Print "Введите число N от 0 до 1 миллиарда: ";
Input N
A = Int(Rnd (1)*14) + 2 ' Случайно выбираем основание от 2 до 16
' Зашифровываем введенное число со случайным основанием
i = 0:  strN1 = ""
Do While N > 0
M =  N Mod A
If M = 10 Then
     strN1 = "A" &  Trim(strN1)
ElseIf M = 11 Then strN1 = "B" & Trim(strN1)  
ElseIf M = 12 Then strN1 = "C" & Trim(strN1)
ElseIf M = 13 Then strN1 = "D" & Trim(strN1) 
ElseIf M = 14 Then strN1 = "E" & Trim(strN1) 
ElseIf M = 15 Then strN1 = "F" & Trim(strN1)  
Else 
     strN1 = Trim(Str(M)) & Trim(strN1)
End If
N = Int (N / A)
i = i + 1
Loop
Print "Число N с неизвестным основанием А: " & strN1
' Зашифровали число, теперь подбираем неизвестное основание
LngN1 = 0
For A = 2 To 16
For i = 1 To Len(strN1)
M = Val (Mid (strN1,  Len(strN1) - i + 1, 1))
If Trim (Str (M)) = "A" Then
    LngN1 =  LngN1 + 10*A^(i-1)
ElseIf Trim (Str (M)) = "B" Then LngN1 = LngN1 + 11*A^(i-1) 
ElseIf Trim (Str (M)) = "C" Then LngN1 = LngN1 + 12*A^(i-1)  
ElseIf Trim (Str (M)) = "D" Then LngN1 = LngN1 + 13*A^(i-1)  
ElseIf Trim (Str (M)) = "E" Then LngN1 = LngN1 + 14*A^(i-1)  
ElseIf Trim (Str (M)) = "F" Then LngN1 = LngN1 + 15*A^(i-1)  
Else
    LngN1 =  LngN1 + M*A^(i-1) 
End If
Next i
If LngN1 = N Then Exit For
Next A
Print "Неизвестное основание А = " & A
End

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

Перевести из языка Си++ в Паскаль #include #include #include #include #include using namespace std; int main(){ srand(time(NULL)); int n; cin»n; int mass[n][n]; int mass1[n][n]; for(int i=0; i for(int j=0; j mass[i][j]=rand()%10*pow(-1, rand()%2); cout«setw(4)«mass[i][j]«' '; } cout«endl; } cout«endl; for(int i=0;i for(int j=0; j mass1[j][n-1-i]=mass[i][j]; } } for(int i=0; i for(int j=0; j cout«setw(4)«mass1[i][j]; if(mass1[i][j]>0){ mass1[i][j]=1; } } cout«endl; } cout«endl; for(int i=0; i for(int j=0; j cout«setw(4)«mass1[i][j]; } cout«endl; } return 0; }
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

Александрович686
didizain
atlantika7
Иван1764
Leonidovich_Elena771
delta88
syana80
ALLA1868
Semenova
mac4roc3781
Лилит_Шутова
versalmoda2971
tagirova1
Belov
office3