Ziomnexpl

liczenie stringu C#

Nov 20th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2.  
  3. namespace liczenie_stringu
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("podaj tekst do napisania pionowo");
  10.             string tekst = Console.ReadLine();
  11.             int i = 0;
  12.             int a = tekst.Length;
  13.             Console.WriteLine("liczba znaków = " + a);
  14.         li:
  15.             if (i == a) goto end;
  16.             Console.WriteLine(tekst[i]);
  17.             i = i + 1;
  18.             goto li;
  19.         end:
  20.             return;
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment