oyunabaduraeva
?>

Си шарп. Вывести трапецию по центру консольного окна, закрашенного введенным символом

Информатика

Ответы

alekseisamohvolov7

namespace a

{

   class Program

   {

       static void Main(string[] args)

       {

       }

   }

}  

Shishkinna2002

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("[Поздравляем, вы нарисовали самую идеальную трапецию во вселенной]");

       }

   }

}  

opscosmiclatte7868

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.

     

Объяснение:

Anastasiya Yevseeva948

#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;

}

Объяснение:

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

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

Си шарп. Вывести трапецию по центру консольного окна, закрашенного введенным символом
Ваше имя (никнейм)*
Email*
Комментарий*

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

spodobnyi
Levinalx4938
mmi15
anusha33325
Александрович833
angelinaugan119
Svetlana ALLA
Postnikova-StreltsovaKyulbyakova
janepustu
Faed_Arakcheeva
Бегун-Марина
uttgroup
okutihamv
lescha-77766
rusart3