if (Number.isNaN(theNum)){
console.log("это не число");
} else{
console.log("квадратный корень " + theNum * theNum);
}
bool DigitOdd(int number) {
auto result = true;
while (number > 0)
{
int digit = number % 10;
number /= 10;
if (digit % 2 == 0) {
result = false;
break;
}
}
return result;
}
\[(?<id>id(?<idNumber>.*?))\|(?<notify>@(?<name>.*?))\]
Group `id` id296954377
Group `idNumber` 296954377
Group `notify` @wert43211
Group `name` wert43211
$re = '/\[(?<id>id(?<idNumber>.*?))\|(?<notify>@(?<name>.*?))\]/m';
$str = '[id296954377|@wert43211]';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
void Foo (Animal &arr)
class Animal {
public:
std::string Name;
};
void Foo(Animal *arr) {
cout << arr[1].Name.c_str() << endl;
}
void main()
{
Animal *animals = new Animal[3];
animals[0].Name = "Cat";
animals[1].Name = "Dog";
animals[2].Name = "Cow";
Foo(animals);
animals[1].Name = "Change to Dog";
Foo(animals);
}
'Content-Type': 'application/x-www-form-urlencoded',
body: 'userPhone=1&userName=' + userName
let user = {
name: 'John',
surname: 'Smith'
};
let response = await fetch('/article/fetch/post/user', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
body: JSON.stringify(user)
});
let result = await response.json();
alert(result.message);