Почему выдаёт ошибку?
using System;
class VideoSharp
{
static void Main()
{
string[] s = Console.ReadLine().Split('.');
int year = int.Parse(s[0]);
int month = int.Parse(s[1]);
Console.WriteLine("Mon Tue Wed Thu Fri Sat Sun");
DateTime data = new DateTime(year, month, 1);
int len = DateTime.DaysInMonth(year, month);
int day = (int)data.DayOfWeek;
if (day == 0) day = 7;
day--;
if (year == 1752 && month == 9)
{
Console.WriteLine(" 1 2 14 15 16 17");
Console.WriteLine(" 18 19 20 21 22 23 24");
Console.WriteLine(" 25 26 27 28 29 30");
}
else
{
for (int i = 0; i < day; i++)
Console.Write(" ");
for (int i = 1; i <= len; i++)
{
int d = (day + i - 1) % 7;
if (d < 6 && i != len) Console.Write("{0,3} ", i);
else Console.WriteLine("{0,3}", i);
}
}
}
}
Потому что считываться должно a, b , x, а у вас a, x, b
Подскажите почему у меня ответ не совпадает?
double a,b, x, y;
a = double.Parse(Console.ReadLine());
x = double.Parse(Console.ReadLine());
b = double.Parse(Console.ReadLine());
y = (a+b)*(a+b)*Math.Sqrt((a+x)/(b+x))*Math.Log(a+x);
Console.WriteLine("{0:0.0000}", y);
Привет, я протестировал твой вариант и твоя ошибка в том, что ты перепутал имена переменных. на 1 строке у тебя "Г, Д ,Э, М, К, О, П;" вместо "Г Д Э П К О М", то есть ты перепутал мурзиков с подьездами. А считываешь данные в вообще неправильном порядке, а здесь это важно. Робот Шарп пишет на 7-ми строках поочерёдно сначала Г, потом Д Э П К О М по порядку, а ты считываешь М как К и К как М соответсвенно, в этом твоя ошибка, будь внимательнее :)
Почему не дает 100%???!!!
using System;
class VideoSharp
{
static void Main()
{
int Г,Д,Э,М,К,О,П;
int домов,квартир,мурзиков,окон;
Г = int.Parse(Console.ReadLine());
Д = int.Parse(Console.ReadLine());
Э = int.Parse(Console.ReadLine());
П = int.Parse(Console.ReadLine());
М = int.Parse(Console.ReadLine());
О = int.Parse(Console.ReadLine());
К = int.Parse(Console.ReadLine());
домов = Г * Д;
квартир = домов * Э * П * К;
окон = квартир * О;
мурзиков = домов * М;
Console.WriteLine(домов);
Console.WriteLine(квартир);
Console.WriteLine(окон);
Console.WriteLine(мурзиков);
}
}