Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- namespace SLAB6
- {
- class MainClass
- {
- public static void Main (string[] args)
- {
- string oneStr, twoStr;
- oneStr = Console.ReadLine ();
- twoStr = Console.ReadLine ();
- Console.WriteLine ("Поиск строки в строке с начала = " + oneStr.IndexOf(twoStr));
- Console.WriteLine ("Поиск строки в строке с конца = " + oneStr.LastIndexOf(twoStr));
- oneStr = Console.ReadLine ();
- twoStr = Console.ReadLine ();
- string[] Pieces = oneStr.Split(twoStr[0]);
- foreach (string str2 in Pieces) {
- Console.WriteLine (str2);
- }
- int a = 38;
- Console.WriteLine("a = {0:d4}", a);
- int b = 255;
- Console.WriteLine("b = {0:X}", b);
- int c = 255;
- Console.WriteLine("c ={0:x}", c);
- double pi = 3.1415926;
- Console.WriteLine("pi = {0:f2}", pi);
- double d=1003.214;
- Console.WriteLine("d={0:c}", d);
- double e=213.1;
- Console.WriteLine("e={0:e}", e);
- DateTime dt = new DateTime(2018, 3, 9, 16, 5, 7, 123);
- Console.WriteLine("{0:y yy yyy yyyy}", dt);
- Console.WriteLine("{0:d dd ddd dddd}", dt);
- Console.WriteLine("{0:M MM MMM MMMM}", dt);
- StringBuilder MyStringBuilder = new StringBuilder("Hello World!");
- MyStringBuilder.Append(" What a beautiful day.");
- Console.WriteLine(MyStringBuilder);
- string str = Console.ReadLine ();
- int len = str.Length;
- int oldLen = len;
- len = len / 2;
- int i = 0;
- char temp;
- char[] chars = str.ToCharArray ();
- while (i < len) {
- temp = str [i];
- chars [i] = chars [oldLen - i -1];
- chars [oldLen - i - 1] = temp;
- i++;
- }
- Console.WriteLine (chars);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement