Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Проверка на одинаковые цифры в пятизначном числе.
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { if(Check(Console.ReadLine()) == true) { Console.WriteLine("Есть одинаковые цифры."); } else { Console.WriteLine("Нет одинаковых цифр."); } } static bool Check(string number) { char[] x = number.ToCharArray(); int count = 0; for(int i=0;i<x.Length;i++) { for(int y=0;y<x.Length ;y++) { if(x[i] == x[y]) { count++; } } } if (count <= 5) { return false; } else { return true; } } } }
run
|
edit
|
history
|
help
0
Random number IF var change
datetime
N
054325462
Game_snake
PolyMorphism
count number of words in string
decimal to binary
Fórum ➡ GroupJoin'ing Books and Orders ( with Zip'ped output ) ♦
aba