#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
const int n = 10;
int main()
{
int a[n][n];
cout << "Source array: \n";
srand(time(NULL));
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
a[i][j] = rand() % 500 + 100;
cout << a[i][j] << " ";
}
cout << endl;
}
cout << "New array: \n";
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if ((a[i][j] % 2 == 0) && (i == j))
a[i][j] = 100;
cout << a[i][j] << " ";
}
cout << endl;
}
//system("pause");
return 0;
}
Using System;
using System.Linq;
using System.Numerics;
class Program
{
public static readonly char[] hex_chars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
static void Main()
{
var random = new Random(DateTime.Now.Millisecond);
var long_hex = new char[random.Next(10, 255)];
for (var i = 0; i < long_hex.Length; i++)
{
long_hex[i] = hex_chars[random.Next(0, 15)];
Console.Write(long_hex[i] + " ");
}
Console.WriteLine();
LongHexToNumber(long_hex);
Console.ReadKey();
}
static void LongHexToNumber(char[] long_hex)
{
var s = long_hex.Aggregate("", (xs, x) => x + xs);
var number = BigInteger.Parse(s, System.Globalization.NumberStyles.AllowHexSpecifier);
Console.WriteLine("Число = {0}", number);
Console.WriteLine("Число(HEX) = {0:X}", number);
Console.WriteLine("Входит в диапазон int: {0}", int.MaxValue >= number && int.MinValue <= number);
Console.WriteLine("Входит в диапазон uint: {0}", uint.MaxValue >= number && uint.MinValue <= number);
Console.WriteLine("Входит в диапазон long: {0}", long.MaxValue >= number && long.MinValue <= number);
Console.WriteLine("Входит в диапазон ulong: {0}", ulong.MaxValue >= number && ulong.MinValue <= number);
}
}
Только еще надо подключить библиотеку System.Numerics.dll
Для этого надо в проекте найти Reference, правой кнопкой -> Add Reference (откроется окошко) и там в стандартных библиотеках найти нужную
Обычное - это в десятичной системе? мы не ацтеки?
тогда - 1653
звездачка заменяе любое количество символов. Так что просто начало и расширение по краям
t*.exe