Advertisement
KitSaels

pocet.cs

Apr 30th, 2024
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. internal class Program {
  5.  
  6.     static void Main(string[] args) {
  7.         Console.Write("Zadej řetězec: ");
  8.         string line = Console.ReadLine();
  9.         string[] words = line.Split(' ');
  10.         Console.WriteLine(words.Length);
  11.         foreach (string word in words) {
  12.             if (word.Length >=1) {
  13.                 Console.Write(word[0]);
  14.                 Console.Write(' ');
  15.             }
  16.         }
  17.         Console.WriteLine();
  18.         Console.WriteLine(line.ToUpper());
  19.         Console.WriteLine(line.Length);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement