using System.Threading.Tasks;
namespace trapec
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("[Введите символ, из которого будете рисовать трапецию]");
string c = Console.ReadLine();
Console.WriteLine(" " + c + " " + c + " " + c + " " + c + "");
Console.WriteLine(" " + c + " " + c + " " + c + " " + c + " " + c + " " + c + " ");
Console.WriteLine(" " + c + " " + c + " " + c + " " + c + " " + c + " " + c + " " + c + " " + c + " ");
Console.WriteLine("[Поздравляем, вы нарисовали самую идеальную трапецию во вселенной]");
}
}
}
program an;
var n:integer;
s1,s2:string;
i,j:integer;
begin
s1[1]:='*';
s2[1]:=' ';
for j:=2 to n do
begin
if s1[j-1]='*' then
s1[j]:=' '
else
s1[j]:='*';
if s2[j-1]='*' then
s2[j]:=' '
else
s2[j]:='*';
end;
j:=1;
for i:=1 to n do
begin
if j=1 then
begin
writeln(s1);
j:=0;
end
else
begin
j:=1;
writeln(s2);
end
end;
end.
Объяснение:
#include <iostream>
using namespace std;
int main()
{
float a;
int b;
double c;
cout<<"Choose mode: 1 - KB to bit, 2 - bit to KB :";
cin>>b;
switch(b)
{
case 1:
cout<<"Enter KByte count :"; cin>>a;
c = a * 8 * 1024;
cout <<a<<" KByte = "<<c<<" bit";
break;
case 2:
cout<<"Enter bit count :"; cin>>a;
c = a /1024/8;
cout <<a<<" bit= "<<c<<" KByte";
break;
}
return 0;
}
Объяснение:
namespace a
{
class Program
{
static void Main(string[] args)
{
}
}
}