Labo 6
Labo 6
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
namespace spiral
{
class Program
{
static void Main(string[] args)
{
string s = ReadLine();
////Shifreleme////
byte[] b = Encoding.UTF8.GetBytes(s);
int n = b.Length;
int w = 0, h = 0; //acarlar
bool bb = false;
for(int i1 = 1;i1<n ; i1++)
{
for (int j1 = 1; j1 < n; j1++)
{
if (4 * i1 * j1 >= n + 4 && 2 * i1 >= 4)
{
w = 2 * i1;
h = 2 * j1;
bb = true;
break;
}
}
if (bb)
{
break;
}
}
byte[,] b1 = new byte[h, w];
for(int i1 = 0; i1 < b.Length; i1++)
{
b1[i1 / w, i1 % w] = b[i1];
}
////Deshifreleme/////