using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
List res = new List();
for(int i=1000;i<10000; i++)
{
int[] sb=new int[4];
sb[0] = i / 1000;
sb[1] = (i / 100) % 10;
sb[2] = (i % 100)/10;
sb[3] = i % 10;
if (sb.Sum() == 15)
res.Add(i);
}
Console.WriteLine("Искомые числа:");
for (int i = 0; i < res.Count; i++)
Console.Write("{0} ", res[i]);
Console.ReadKey();
}
}
}
Объяснение:
#include <iostream>
using ll = long long;
using ld = long double;
#define yes cout << "YES" << "\n"
#define no cout << "NO" << "\n"
#define three cout << "Равносторонний"
#define two cout << "Равнобедренный"
#define one cout << "Разносторонний"
using namespace std;
bool exist(ll a, ll b, ll c){
return (a + b > c) && (a + c > b) && (b + c > a);
}
void type(ll a, ll b, ll c){
if(a == b && b == c)
three;
else if(a == b || b == c || a == c)
two;
else
one;
}
signed main() {
ll a,b,c;
cin >> a >> b >> c;
if(exist(a,b,c)){
yes;
type(a,b,c);
} else
no;
}
Поделитесь своими знаниями, ответьте на вопрос:
бег- бес миг- мис- мир- сир бант- бинтшар- шагмуха- мукарак- маквек- вескоса-росакуб- дубслон- клон