Advertisement
myname0

практикум8_III_11

Oct 30th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. static void Main(string[] args)
  2.         {
  3.             string str  = Console.ReadLine();
  4.             char [] punkt = {' ', ',' , '.', ';', ':', '?', '!'};
  5.             string[] word = str.Split(punkt);
  6.             int temp = 0;
  7.             for (int i = 0; i < word.Length; i++)
  8.             {
  9.                 if (word[i].Length > temp)
  10.                     temp = word[i].Length;
  11.             }
  12.             for (int i = 0; i < word.Length; i++)
  13.             {
  14.                 if (word[i].Length == temp)
  15.                 {
  16.                     Console.Write(word[i]);
  17.                     Console.Write(" ");
  18.                 }
  19.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement