Skip to content

Instantly share code, notes, and snippets.

@gordinmitya
gordinmitya / Guess.cs
Last active April 18, 2016 07:30 — forked from anonymous/Guess
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Index1
{
public class Program
{
<?php
$key = "GDSHG4385743";
$attempt = 0;
if (isset($_REQUEST["input"]))
{
$attempt=isset($_REQUEST["attempt"])?(int)$_REQUEST["attempt"]:0;
$x = $_REQUEST["x"];
$randNumber = encode($_REQUEST["randNumber"], $key);
if ($attempt<7)
@gordinmitya
gordinmitya / isprime.pas
Created November 23, 2015 14:29
Составить программу для проверки, можно ли заданное натуральное число N представить в виде квадрата простого числа.
var n, h: Integer;
function isPrime(n: INteger): Boolean;
var i: integer;
begin
isPrime:=true;
//for i:=2 to n-1 do - как тебе больше нравится
for i:=2 to trunc(sqrt(n)) do
if n mod i = 0 then
isPrime := false;