+ Нов въпрос
stilko13 1 Точки

## 08.Scholarship

Здравейте, на тази задача изкарвам 93/100 точки в judge дали някой може да ме посъветва къде греша.

using System;

namespace SumSeconds
{
class Program
{
static void Main(string[] args)
{
double socialScholarships = avgSalary * 0.35;
double gradeScholarship = 25 * avgScore;
if (avgScore >= 5.50 && gradeScholarship >= socialScholarships)
{
Console.WriteLine(\$"You get a scholarship for excellent results {Math.Floor(gradeScholarship)} BGN");
} else if (income < avgSalary && avgScore > 4.50){
Console.WriteLine(\$"You get a Social scholarship {Math.Floor(socialScholarships)} BGN");
}
else
{
Console.WriteLine("You cannot get a scholarship!");
}
}
}
}

Тагове:
1
kkaraivanov 490 Точки

Здравей. Пускам ти едно решение, мисля че ще откриеш грешките.

``````            double income = double.Parse(Console.ReadLine());

double socialScholarship = Math.Floor(minimalSalary * 0.35);
double execellentSuccessScholarship = Math.Floor(averageSuccess * 25);
double printEscelentScholership = 0;

if (socialScholarship > execellentSuccessScholarship)
{
printEscelentScholership = socialScholarship;
}
else
{
printEscelentScholership = execellentSuccessScholarship;
}

if (income <= minimalSalary && averageSuccess > 4.5 && averageSuccess < 5.5)
{
Console.WriteLine(\$"You get a Social scholarship {socialScholarship} BGN");
}
else if (income <= minimalSalary && averageSuccess >= 5.5)
{
Console.WriteLine(\$"You get a scholarship for excellent results {printEscelentScholership} BGN");
}
else if (income > minimalSalary && averageSuccess >= 5.5)
{
Console.WriteLine(\$"You get a scholarship for excellent results {execellentSuccessScholarship} BGN");
}
else
{
Console.WriteLine("You cannot get a scholarship!");
}``````

0
krum_43 535 Точки

Ето ти още едно решение 100/100.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Scholarship
{
class Program
{
static void Main(string[] args)
{
double socialscholarship = 0.35 * mindohod;
double schoolmoney = grade * 25;
int socialschipround =(int)Math.Floor(socialscholarship);
int scholmoneyround = (int)Math.Floor(schoolmoney);
{
Console.WriteLine("You cannot get a scholarship!");
return;
}
{
if(dohodProPerson<mindohod)
{
Console.WriteLine(\$"You get a Social scholarship {socialschipround} BGN");
return;
}
else
{
Console.WriteLine("You cannot get a scholarship!");
}
}
{
if (dohodProPerson < mindohod)
{
if (schoolmoney >= socialscholarship)
{
Console.WriteLine(\$"You get a scholarship for excellent results {scholmoneyround} BGN");
}
else
{
Console.WriteLine(\$"You get a Social scholarship {socialschipround} BGN");
return;
}
}
else
{
Console.WriteLine(\$"You get a scholarship for excellent results {scholmoneyround} BGN");
}

}
}
}
}

0