На C# или PASCAL // PS.// БЛАГОДАРЮ! Задание 2
Расшифровать текст на русском языке, зашифрованный шифром Плейфера с применением ключевого слова «республика».
Текст для расшифровки:
Задание 3
Известно, что текст зашифрован методом перестановки, причем применяласть перестановка только внутри блока данных. Известен ключ шифрации. Задача – расшифровать текст. Ключ для всех вариантов - 365142.
Текст для расшифровки:
к_ттсешрфзиаам_онвомоедтртспееоикавн
Var a,b,h: double;
Begin
write('Введите a: '); read(a);
write('Введите b: '); read(b);
write('Введите h: '); read(h);
writeln('');
writeln('| x | F(x) |');
writeln('|||');
while a <= b do begin
writeln('|',a:5,'|', a-abs(cos(a)):20,'|');
a:= a + h;
end;
write('|||');
end.
С#
class Program
{
static void Main(string[] args)
{
Console.Write("Введите a: ");
double a = Convert.ToDouble(Console.ReadLine());
Console.Write("Введите b: ");
double b = Convert.ToDouble(Console.ReadLine());
Console.Write("Введите h: ");
double h = Convert.ToDouble(Console.ReadLine());
Console.WriteLine(" ");
Console.WriteLine("| x | F(x) |");
Console.WriteLine("|||");
while (a <= b)
{
Console.WriteLine("|{0,5}|{1,15:0.000000000|}", a, a-Math.Abs(Math.Cos(a)));
a += h;
}
Console.WriteLine("|||");
Console.ReadLine();
}
}
C/C++
#include "stdafx.h"
#include "locale.h"
#include "stdlib.h"
#include <math.h>
#include <iostream>
using namespace std;
int main()
{
double a=0,b=0,h=0;
setlocale(0,"russian");
printf("Введите a: ");
cin >> a;
printf("Введите b: ");
cin >> b;
printf("Введите h: ");
cin >> h;
printf(" \n");
printf("| x | F(x) |\n");
printf("|||\n");
while (a <= b)
{
printf("|%5.2f|%14.9f|\n", a, a-abs(cos(a)));
a += h;
}
printf("|||\n");
system("pause");
}