Дата активности | Консольный раздел | Прогресс | ||
---|---|---|---|---|
2016-03-05 | task1 | Целые числа | 86 % | |
2016-03-02 | task1 | Строки | 100 % | |
2016-02-20 | task1 | Семантика | 100 % | |
Итого: | 97 % |
string[] data1 = Console.ReadLine().Split(' ');
string[] data2 = Console.ReadLine().Split(' ');
string[] data3 = Console.ReadLine().Split(' ');
string[] data4 = Console.ReadLine().Split(' ');
string[] data5 = Console.ReadLine().Split(' ');
int a = Convert.ToInt32(data1[data1.Length - 1]);
int b = Convert.ToInt32(data2[data2.Length - 1]);
int c = Convert.ToInt32(data3[data3.Length - 1]);
int d = Convert.ToInt32(data4[data4.Length - 1]);
int e = Convert.ToInt32(data5[data5.Length - 1]);
Console.WriteLine("{0} {1} {2} {3} {4}",a,b,c,d,e);
Console.WriteLine(a + b + c + d + e);
string[] data = Console.ReadLine().Split(' ');
long a;
long v;
long b;
long s;
long d;
a = Convert.ToInt64(data[0]);
v = Convert.ToInt64(data[1]);
b = Convert.ToInt64(data[2]);
d = Convert.ToInt64(data[3]);
s = Convert.ToInt64(data[4]);
Console.WriteLine(a + v + b + d + s);
int a;
int b;
a = Convert.ToInt32(Console.ReadLine());
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("{0} / {1} = {2}", a, b, a / b);
Console.WriteLine("{0} % {1} = {2}", a, b, a % b);
string[] data = Console.ReadLine().Split(' ');
int a;
int v;
a = Convert.ToInt32(data[0]);
v = Convert.ToInt32(data[1]);
Console.WriteLine( a+ v);
string str = Console.ReadLine(); ;
string str2 = str.TrimStart(new char[] { '[', ' ','\t' });
Console.WriteLine("[{0}",str2);
string str3 = str.TrimEnd(new char[] { ']', ' ', '\t' });
Console.WriteLine("{0}]", str3);
string str4 = str.Trim(new char[] { '[', ']', ' ', '\t' });
Console.WriteLine("[{0}]", str4);
string str = Console.ReadLine(); ;
string str2 = str.TrimStart(new char[] { '[', ' ','\t' });
Console.WriteLine("[{0}",str2);
string str3 = str.TrimEnd(new char[] { ']', ' ', '\t' });
Console.WriteLine("{0}]", str3);
string str4 = str.Trim(new char[] { '[', ']', ' ', '\t' });
Console.WriteLine("[{0}]", str4);
string str = Console.ReadLine();
str = str.ToLower();
Console.WriteLine(str.StartsWith("hello"));
Console.WriteLine(str.EndsWith("."));
// Console.ReadKey();
string str = Console.ReadLine();
int a = str.IndexOf('(');
int b = str.IndexOf(')');
string str2 = str.Substring(a+1, b - a-1);
Console.WriteLine(str2);
//www.VideoSharp.info/Консоль/Строки/Replace
using System;
class VideoSharp
{
static void Main()
{
string str1 = Console.ReadLine(); //BURATINO -> BUROTINA
str1 = str1.Replace('A', '~');
Console.WriteLine(str1);
//"а" меняем на ~
str1 = str1.Replace('O', 'A');
Console.WriteLine(str1);
//о меняем на ~
str1 = str1.Replace('~', 'O');
Console.WriteLine(str1);
//~ меняем на o
str1 = str1.Replace('a', '~');
Console.WriteLine(str1);
//"а" меняем на ~
str1 = str1.Replace('o', 'a');
Console.WriteLine(str1);
//о меняем на ~
str1 = str1.Replace('~', 'o');
Console.WriteLine(str1);
//~ меняем на o
}
}
//www.V//www.VideoSharp.info/Консоль/Строки/ToLower/Upper
using System;
class VideoSharp
{
static void Main()
{
string verx = Console.ReadLine();
string nis = Console.ReadLine();
verx=verx.ToLower();
nis=nis.ToLower();
if(verx==nis)
{
Console.WriteLine("True");
}
else
{
Console.WriteLine("False");
}
//Console.ReadKey();
}
}