Дата активности | Консольный раздел | Прогресс | ||
---|---|---|---|---|
2021-06-13 | book | 101. Математика | 72 % | |
2021-03-25 | book | 100. Массивы | 100 % | |
2021-03-24 | book | 011. Циклы | 100 % | |
2021-03-24 | book | 010. Условия | 100 % | |
2021-03-23 | book | 001. Числа | 100 % | |
2021-03-23 | book | 000. Строки | 100 % | |
Итого: | 96 % |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ComeBack1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("-------------------------");
Console.WriteLine("| t | x | y |");
Console.WriteLine("-------------------------");
for (double i = 0.0; i < 7.01; i+=0.1)
{
double x = Math.Sin(3 * i) + 3 * Math.Cos(i);
double y = Math.Cos(2*i);
Console.WriteLine("| {0,3:f1} | {1,6:f3} | {2,6:f3} |",i,x,y);
}
}
}
}
double a = double.Parse(Console.ReadLine());
double x = double.Parse(Console.ReadLine());
double result = (Math.Pow(Math.Pow(x, 3), 0.25) + a * x) / (Math.Log(Math.Sqrt(Math.Pow(a, 2) + Math.Sqrt(x)), Math.E));
Console.WriteLine("{0:0.0000}", result);
int a = int.Parse(Console.ReadLine());
int j = 0;
int[] max = new int[a];
string[] nums = Console.ReadLine().Split();
for (int i = 0; i < nums.Length; i++)
{
int converted = Convert.ToInt32(nums[i]);
if (converted == 0) j++;
}
Console.WriteLine(j);
int a = int.Parse(Console.ReadLine());
int[] max = new int[a];
string[] nums = Console.ReadLine().Split();
int j = 0;
for (int i = 0; i < nums.Length; i++)
{
int converted = Convert.ToInt32(nums[i]);
if (converted == 0) j++;
}
Console.WriteLine(j);
зачем вы там пишите по 100 строк кода?
int a = int.Parse(Console.ReadLine());
int[] max = new int[a];
int[] nums = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);
Console.WriteLine(nums.Min()+" "+nums.Max());
int a = int.Parse(Console.ReadLine());
int[] max = new int[a];
int[] nums = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);
for (int i = 0; i < nums.Length; i++)
{
if (i % 2 == 0)
{
nums[i] *= nums[i];
}
else
{
nums[i] *= 2;
}
Console.Write(nums[i] + " ");
}
Console.WriteLine();
int a = int.Parse(Console.ReadLine());
int[] max = new int[a];
string[] value = Console.ReadLine().Split();
string arg = null;
for (int i = 0; i < value.Length; i++)
{
int inc = int.Parse(value[i]);
inc += 1;
string ac = inc + ",";
if (i == value.Length -1)
{
break;
}
Console.Write(ac);
arg = ac;
}
Console.WriteLine(arg.Replace(",","."));
int a = Convert.ToInt32(Console.ReadLine());
int[] nums = new int[a];
string[] r = Console.ReadLine().Split();
Array.Reverse(r);
foreach (var item in r)
{
Console.Write(item + " ");
}
Console.WriteLine();
int a = Convert.ToInt32(Console.ReadLine());
int[] array = new int[a];
for (int i = 0; i < array.Length; i++)
{
array[i] = 1;
Console.WriteLine(array[i]);
}
string a = Console.ReadLine();
Console.WriteLine(a.Length);
:)
Зачем сюда вообще break?
int a = int.Parse(Console.ReadLine());
int max = 0;
for (int i = 1; i < a; i++)
{
if (a % i == 0)
{
max = i;
}
if(false){break;}
}
Console.WriteLine(max);
Зачем сюда вообще break?
int a = 256;
int max = 0;
for (int i = 1; i < a; i++)
{
if (a % i == 0)
{
max = i;
}
}
Console.WriteLine(max);
for (int i = 1; i < 100; i++)
{
if (i % 7 == 0)
{
Console.WriteLine(i);
continue;
}
}
byte a = byte.Parse(Console.ReadLine());
switch (a)
{
case 1:
Console.WriteLine("понедельник");
break;
case 2:
Console.WriteLine("вторник");
break;
case 3:
Console.WriteLine("среда");
break;
case 4:
Console.WriteLine("четверг");
break;
case 5:
Console.WriteLine("пятница");
break;
case 6:
Console.WriteLine("суббота");
break;
case 7:
Console.WriteLine("воскресенье");
break;
default:
Console.WriteLine("Введи число от 1 до 7");
break;
}
//take user array
int[] a = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);
//must if
if (true)
{
//sorted Array
int[] sorted = a.OrderBy(i => i).ToArray();
//output sorted array
for (int i = 0; i < sorted.Length; i++)
{
Console.WriteLine(sorted[i]);
}
}
string[] a = Console.ReadLine().Split();
int a1 = int.Parse(a[0]), a2 = int.Parse(a[1]), a3 = int.Parse(a[2]);
if (a1 == a2&&a2==a3&&a1==a3)
{
Console.WriteLine("YES");
}
else
{
Console.WriteLine("NO");
}
или же:
Console.WriteLine(a1 == a2 && a2 == a3 && a1 == a3?"YES":"");
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
if (a > b)
{
Console.WriteLine(a);
}
else
{
Console.WriteLine(b);
}
Console.WriteLine(a>b?a:b);
int a = int.Parse(Console.ReadLine());
Console.WriteLine(a);
Console.WriteLine("{0:d5}",a);
Console.WriteLine("{0,5:d}",a);
string[] a = Console.ReadLine().Split();
int n, n1;
n = int.Parse(a[0]);
n1 = int.Parse(a[1]);
Console.WriteLine(n+n1);
Console.WriteLine(n-n1);
Console.WriteLine(n*n1);
Console.WriteLine(n/n1);
Console.WriteLine(n%n1);
Console.WriteLine("byte {0} {1}",byte.MinValue,byte.MaxValue);
Console.WriteLine("short {0} {1}", short.MinValue, short.MaxValue);
Console.WriteLine("ushort {0} {1}", ushort.MinValue, ushort.MaxValue);
Console.WriteLine("int {0} {1}", int.MinValue, int.MaxValue);
Console.WriteLine("uint {0} {1}", uint.MinValue, uint.MaxValue);
Console.WriteLine("long {0} {1}", long.MinValue, long.MaxValue);
Console.WriteLine("ulong {0} {1}", ulong.MinValue, ulong.MaxValue);
int usernum = int.Parse(Console.ReadLine());
int usernum2 = Convert.ToInt32(Console.ReadLine());
string usernum3 = Console.ReadLine();
int parse;
int.TryParse(usernum3, out parse);
Console.WriteLine((usernum + 1) + " " + (usernum2 + 1) + " " + (parse + 1));