id
int64
0
100M
language
stringclasses
3 values
prog_lang
stringclasses
6 values
category
stringclasses
10 values
difficulty
stringclasses
3 values
instruction
stringlengths
30
86
output
stringlengths
7
192
text
stringlengths
92
300
59,053,764
ru
Java
logic_ops
advanced
Напишите на Java логику проверки, является ли год 2029 високосным.
public bool IsLeap() { int y = 2029; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на Java логику проверки, является ли год 2029 високосным. ### Response: public bool IsLeap() { int y = 2029; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
59,694,430
ru
Python
array_ops
intermediate
Напишите на Python функцию, которая разворачивает список задом наперед.
def reverse_list(arr): return arr[::-1]
### Instruction: Напишите на Python функцию, которая разворачивает список задом наперед. ### Response: def reverse_list(arr): return arr[::-1]
88,145,785
kk
C++
logic_ops
intermediate
C++ тилінде 2066 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
public bool IsLeap() { int y = 2066; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: C++ тилінде 2066 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: public bool IsLeap() { int y = 2066; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
32,278,027
ru
Java
logic_ops
advanced
Напишите на Java логику проверки, является ли год 1925 високосным.
public bool IsLeap() { int y = 1925; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на Java логику проверки, является ли год 1925 високосным. ### Response: public bool IsLeap() { int y = 1925; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
60,319,009
kk
Python
logic_ops
intermediate
Python тилінде 497 санының жай сан екенін анықтайтын функцияны жазыңыз.
def is_prime(): n = 497 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
### Instruction: Python тилінде 497 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: def is_prime(): n = 497 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
61,418,747
kk
Python
array_ops
advanced
Python тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз.
def filter_even(arr): return [x for x in arr if x % 2 == 0]
### Instruction: Python тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз. ### Response: def filter_even(arr): return [x for x in arr if x % 2 == 0]
74,972,672
ru
Python
array_ops
intermediate
Напишите на Python функцию, которая разворачивает список задом наперед.
def reverse_list(arr): return arr[::-1]
### Instruction: Напишите на Python функцию, которая разворачивает список задом наперед. ### Response: def reverse_list(arr): return arr[::-1]
68,353,201
en
Python
string_ops
intermediate
Write a function that converts a string to uppercase in Python.
def to_upper(s): return s.upper()
### Instruction: Write a function that converts a string to uppercase in Python. ### Response: def to_upper(s): return s.upper()
46,362,336
kk
Java
logic_ops
advanced
Java тилінде 2019 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
public bool IsLeap() { int y = 2019; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Java тилінде 2019 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: public bool IsLeap() { int y = 2019; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
15,537,034
ru
Unity
array_ops
advanced
Напишите на Unity функцию, которая фильтрует только четные числа из списка.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: Напишите на Unity функцию, которая фильтрует только четные числа из списка. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
4,695,934
en
C++
var_decl
beginner
How to declare a variable result with value 626861 in C++?
int result = 626861;
### Instruction: How to declare a variable result with value 626861 in C++? ### Response: int result = 626861;
40,437,662
ru
C++
string_ops
intermediate
Напишите на C++ функцию, которая считает количество гласных букв в тексте.
public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
### Instruction: Напишите на C++ функцию, которая считает количество гласных букв в тексте. ### Response: public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
19,669,083
en
Python
array_ops
advanced
Write a function that finds the maximum number in an array in Python.
def get_max(arr): return max(arr)
### Instruction: Write a function that finds the maximum number in an array in Python. ### Response: def get_max(arr): return max(arr)
1,970,653
kk
C#
var_decl
beginner
C# тілінде 269225 мәнімен offset айнымалысын қалай жариялауға болады?
int offset = 269225;
### Instruction: C# тілінде 269225 мәнімен offset айнымалысын қалай жариялауға болады? ### Response: int offset = 269225;
219,990
kk
C++
factorial
advanced
C++ тілінде 7437 санының факториалын есептейтін функция жаз.
long long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } std::cout << factorial(7437) << std::endl;
### Instruction: C++ тілінде 7437 санының факториалын есептейтін функция жаз. ### Response: long long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } std::cout << factorial(7437) << std::endl;
181,082
kk
C++
var_decl
beginner
C++ тілінде 922851 мәнімен level айнымалысын қалай жариялауға болады?
int level = 922851;
### Instruction: C++ тілінде 922851 мәнімен level айнымалысын қалай жариялауға болады? ### Response: int level = 922851;
501,631
ru
C++
sum_n
intermediate
Напиши функцию на C++, которая считает сумму чисел от 1 до 8648.
int sum_to_n(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } std::cout << sum_to_n(8648) << std::endl;
### Instruction: Напиши функцию на C++, которая считает сумму чисел от 1 до 8648. ### Response: int sum_to_n(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } std::cout << sum_to_n(8648) << std::endl;
1,399,034
ru
Python
var_decl
beginner
Как объявить переменную speed со значением 708872 в Python?
speed = 708872
### Instruction: Как объявить переменную speed со значением 708872 в Python? ### Response: speed = 708872
18,210,542
kk
JavaScript
logic_ops
intermediate
JavaScript тилінде 2066 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
function isLeap() { let y = 2066; return y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0); }
### Instruction: JavaScript тилінде 2066 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: function isLeap() { let y = 2066; return y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0); }
71,132,892
kk
Java
array_ops
intermediate
Java тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз.
public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
### Instruction: Java тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
85,711,579
ru
C#
string_ops
advanced
Напишите на C# функцию, которая переводит строку в верхний регистр.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Напишите на C# функцию, которая переводит строку в верхний регистр. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
3,711,071
ru
Java
var_decl
beginner
Как объявить переменную result со значением 419719 в Java?
int result = 419719;
### Instruction: Как объявить переменную result со значением 419719 в Java? ### Response: int result = 419719;
27,297,417
kk
Java
array_ops
advanced
Java тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: Java тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
3,149,362
ru
Python
var_decl
beginner
Как объявить переменную weight со значением 430151 в Python?
weight = 430151
### Instruction: Как объявить переменную weight со значением 430151 в Python? ### Response: weight = 430151
97,492,391
en
Python
logic_ops
intermediate
Write a function that determines if the number 321 is prime in Python.
def is_prime(): n = 321 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
### Instruction: Write a function that determines if the number 321 is prime in Python. ### Response: def is_prime(): n = 321 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
80,353,917
en
Java
string_ops
intermediate
Write a function that counts vowels in a text in Java.
public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
### Instruction: Write a function that counts vowels in a text in Java. ### Response: public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
2,571,808
en
C#
var_decl
beginner
How to declare a variable count with value 989304 in C#?
int count = 989304;
### Instruction: How to declare a variable count with value 989304 in C#? ### Response: int count = 989304;
736,734
ru
Java
sum_n
intermediate
Напиши функцию на Java, которая считает сумму чисел от 1 до 8622.
static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(8622));
### Instruction: Напиши функцию на Java, которая считает сумму чисел от 1 до 8622. ### Response: static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(8622));
72,573,746
ru
C++
array_ops
advanced
Напишите на C++ функцию, которая фильтрует только четные числа из списка.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: Напишите на C++ функцию, которая фильтрует только четные числа из списка. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
4,248,889
kk
Unity
var_decl
beginner
Unity тілінде 261377 мәнімен size айнымалысын қалай жариялауға болады?
int size = 261377;
### Instruction: Unity тілінде 261377 мәнімен size айнымалысын қалай жариялауға болады? ### Response: int size = 261377;
1,400,897
kk
JavaScript
var_decl
beginner
JavaScript тілінде 914426 мәнімен health айнымалысын қалай жариялауға болады?
let health = 914426;
### Instruction: JavaScript тілінде 914426 мәнімен health айнымалысын қалай жариялауға болады? ### Response: let health = 914426;
4,840,172
kk
C++
var_decl
beginner
C++ тілінде 680992 мәнімен count айнымалысын қалай жариялауға болады?
int count = 680992;
### Instruction: C++ тілінде 680992 мәнімен count айнымалысын қалай жариялауға болады? ### Response: int count = 680992;
4,587,742
kk
Python
var_decl
beginner
Python тілінде 874222 мәнімен value айнымалысын қалай жариялауға болады?
value = 874222
### Instruction: Python тілінде 874222 мәнімен value айнымалысын қалай жариялауға болады? ### Response: value = 874222
65,315,513
ru
Python
array_ops
intermediate
Напишите на Python функцию, которая находит максимальное число в массиве.
def get_max(arr): return max(arr)
### Instruction: Напишите на Python функцию, которая находит максимальное число в массиве. ### Response: def get_max(arr): return max(arr)
1,670,454
ru
Python
var_decl
beginner
Как объявить переменную data со значением 51637 в Python?
data = 51637
### Instruction: Как объявить переменную data со значением 51637 в Python? ### Response: data = 51637
49,132,286
kk
Java
array_ops
advanced
Java тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: Java тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
3,553,606
kk
C++
var_decl
beginner
C++ тілінде 121879 мәнімен rate айнымалысын қалай жариялауға болады?
int rate = 121879;
### Instruction: C++ тілінде 121879 мәнімен rate айнымалысын қалай жариялауға болады? ### Response: int rate = 121879;
3,594,113
kk
Unity
var_decl
beginner
Unity тілінде 449456 мәнімен count айнымалысын қалай жариялауға болады?
int count = 449456;
### Instruction: Unity тілінде 449456 мәнімен count айнымалысын қалай жариялауға болады? ### Response: int count = 449456;
11,044,072
kk
C++
array_ops
advanced
C++ тилінде тізімді керісінше айналдыратын функцияны жазыңыз.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: C++ тилінде тізімді керісінше айналдыратын функцияны жазыңыз. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
18,696,728
kk
C#
logic_ops
advanced
C# тилінде 108 санының жай сан екенін анықтайтын функцияны жазыңыз.
public bool IsPrime() { int n = 108; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: C# тилінде 108 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: public bool IsPrime() { int n = 108; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
97,767,129
kk
C++
logic_ops
advanced
C++ тилінде 263 санының жай сан екенін анықтайтын функцияны жазыңыз.
public bool IsPrime() { int n = 263; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: C++ тилінде 263 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: public bool IsPrime() { int n = 263; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
84,713,139
ru
Python
array_ops
intermediate
Напишите на Python функцию, которая находит максимальное число в массиве.
def get_max(arr): return max(arr)
### Instruction: Напишите на Python функцию, которая находит максимальное число в массиве. ### Response: def get_max(arr): return max(arr)
61,866,704
en
Python
logic_ops
intermediate
Write logic to check if the year 1926 is a leap year in Python.
def is_leap(): year = 1926 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
### Instruction: Write logic to check if the year 1926 is a leap year in Python. ### Response: def is_leap(): year = 1926 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
36,340,605
en
C++
logic_ops
intermediate
Write logic to check if the year 2081 is a leap year in C++.
public bool IsLeap() { int y = 2081; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 2081 is a leap year in C++. ### Response: public bool IsLeap() { int y = 2081; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
450,652
ru
JavaScript
factorial
advanced
Напиши функцию на JavaScript, которая вычисляет факториал числа 3646.
function factorial(n) { return n <= 1 ? 1 : n * factorial(n - 1); } console.log(factorial(3646));
### Instruction: Напиши функцию на JavaScript, которая вычисляет факториал числа 3646. ### Response: function factorial(n) { return n <= 1 ? 1 : n * factorial(n - 1); } console.log(factorial(3646));
40,805,993
ru
C++
string_ops
advanced
Напишите на C++ функцию, которая проверяет, является ли строка палиндромом.
public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
### Instruction: Напишите на C++ функцию, которая проверяет, является ли строка палиндромом. ### Response: public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
71,347,398
kk
JavaScript
array_ops
advanced
JavaScript тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз.
const filterEven = arr => arr.filter(x => x % 2 === 0);
### Instruction: JavaScript тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз. ### Response: const filterEven = arr => arr.filter(x => x % 2 === 0);
2,805,806
en
Java
var_decl
beginner
How to declare a variable result with value 296556 in Java?
int result = 296556;
### Instruction: How to declare a variable result with value 296556 in Java? ### Response: int result = 296556;
16,820,747
en
C#
logic_ops
intermediate
Write logic to check if the year 2035 is a leap year in C#.
public bool IsLeap() { int y = 2035; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 2035 is a leap year in C#. ### Response: public bool IsLeap() { int y = 2035; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
52,870,587
en
C#
logic_ops
intermediate
Write a function that determines if the number 160 is prime in C#.
public bool IsPrime() { int n = 160; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Write a function that determines if the number 160 is prime in C#. ### Response: public bool IsPrime() { int n = 160; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
82,525,074
en
C++
string_ops
intermediate
Write a function that checks if a string is a palindrome in C++.
public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
### Instruction: Write a function that checks if a string is a palindrome in C++. ### Response: public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
2,710,956
en
Unity
var_decl
beginner
How to declare a variable score with value 369013 in Unity?
int score = 369013;
### Instruction: How to declare a variable score with value 369013 in Unity? ### Response: int score = 369013;
4,718,395
kk
Unity
var_decl
beginner
Unity тілінде 5394 мәнімен weight айнымалысын қалай жариялауға болады?
int weight = 5394;
### Instruction: Unity тілінде 5394 мәнімен weight айнымалысын қалай жариялауға болады? ### Response: int weight = 5394;
49,568,203
en
Python
array_ops
advanced
Write a function that finds the maximum number in an array in Python.
def get_max(arr): return max(arr)
### Instruction: Write a function that finds the maximum number in an array in Python. ### Response: def get_max(arr): return max(arr)
61,571,321
ru
Unity
array_ops
intermediate
Напишите на Unity функцию, которая разворачивает список задом наперед.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: Напишите на Unity функцию, которая разворачивает список задом наперед. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
27,836,153
kk
Unity
array_ops
advanced
Unity тилінде тізімді керісінше айналдыратын функцияны жазыңыз.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: Unity тилінде тізімді керісінше айналдыратын функцияны жазыңыз. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
15,294,508
kk
JavaScript
string_ops
intermediate
JavaScript тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
const toUpper = s => s.toUpperCase();
### Instruction: JavaScript тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: const toUpper = s => s.toUpperCase();
54,798,260
en
Java
logic_ops
intermediate
Write a function that determines if the number 196 is prime in Java.
public bool IsPrime() { int n = 196; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Write a function that determines if the number 196 is prime in Java. ### Response: public bool IsPrime() { int n = 196; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
87,830,061
ru
C++
array_ops
intermediate
Напишите на C++ функцию, которая находит максимальное число в массиве.
public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
### Instruction: Напишите на C++ функцию, которая находит максимальное число в массиве. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
34,645,958
ru
Java
string_ops
intermediate
Напишите на Java функцию, которая считает количество гласных букв в тексте.
public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
### Instruction: Напишите на Java функцию, которая считает количество гласных букв в тексте. ### Response: public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
801,661
ru
JavaScript
var_decl
beginner
Как объявить переменную buffer со значением 453417 в JavaScript?
let buffer = 453417;
### Instruction: Как объявить переменную buffer со значением 453417 в JavaScript? ### Response: let buffer = 453417;
70,700,500
kk
Java
string_ops
advanced
Java тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз.
public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
### Instruction: Java тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз. ### Response: public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
92,398,301
ru
Java
string_ops
intermediate
Напишите на Java функцию, которая проверяет, является ли строка палиндромом.
public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
### Instruction: Напишите на Java функцию, которая проверяет, является ли строка палиндромом. ### Response: public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
16,535,370
kk
Java
logic_ops
advanced
Java тилінде 400 санының жай сан екенін анықтайтын функцияны жазыңыз.
public bool IsPrime() { int n = 400; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Java тилінде 400 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: public bool IsPrime() { int n = 400; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
66,139
en
Java
factorial
advanced
Write a function in Java that calculates the factorial of 579.
static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(579));
### Instruction: Write a function in Java that calculates the factorial of 579. ### Response: static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(579));
37,827,239
ru
C++
logic_ops
intermediate
Напишите на C++ функцию, определяющую, является ли число 301 простым.
public bool IsPrime() { int n = 301; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Напишите на C++ функцию, определяющую, является ли число 301 простым. ### Response: public bool IsPrime() { int n = 301; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
24,034,490
kk
Unity
logic_ops
advanced
Unity тилінде 2068 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
public bool IsLeap() { int y = 2068; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Unity тилінде 2068 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: public bool IsLeap() { int y = 2068; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
702,640
en
C++
factorial
advanced
Write a function in C++ that calculates the factorial of 4440.
long long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } std::cout << factorial(4440) << std::endl;
### Instruction: Write a function in C++ that calculates the factorial of 4440. ### Response: long long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } std::cout << factorial(4440) << std::endl;
2,165,664
en
C++
var_decl
beginner
How to declare a variable x with value 877275 in C++?
int x = 877275;
### Instruction: How to declare a variable x with value 877275 in C++? ### Response: int x = 877275;
350,795
kk
C#
sum_n
intermediate
C# тілінде 1-ден 3034-ге дейінгі сандардың қосындысын есептейтін функция жаз.
static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(3034));
### Instruction: C# тілінде 1-ден 3034-ге дейінгі сандардың қосындысын есептейтін функция жаз. ### Response: static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(3034));
1,311,752
kk
Python
var_decl
beginner
Python тілінде 195523 мәнімен result айнымалысын қалай жариялауға болады?
result = 195523
### Instruction: Python тілінде 195523 мәнімен result айнымалысын қалай жариялауға болады? ### Response: result = 195523
1,272,380
kk
C#
var_decl
beginner
C# тілінде 498813 мәнімен score айнымалысын қалай жариялауға болады?
int score = 498813;
### Instruction: C# тілінде 498813 мәнімен score айнымалысын қалай жариялауға болады? ### Response: int score = 498813;
35,225,410
en
Python
array_ops
advanced
Write a function that reverses a list in Python.
def reverse_list(arr): return arr[::-1]
### Instruction: Write a function that reverses a list in Python. ### Response: def reverse_list(arr): return arr[::-1]
1,905,981
ru
C++
var_decl
beginner
Как объявить переменную health со значением 902866 в C++?
int health = 902866;
### Instruction: Как объявить переменную health со значением 902866 в C++? ### Response: int health = 902866;
99,882,795
en
JavaScript
logic_ops
intermediate
Write a function that determines if the number 350 is prime in JavaScript.
function isPrime() { let n = 350; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
### Instruction: Write a function that determines if the number 350 is prime in JavaScript. ### Response: function isPrime() { let n = 350; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
17,455,437
ru
C#
logic_ops
advanced
Напишите на C# функцию, определяющую, является ли число 407 простым.
public bool IsPrime() { int n = 407; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Напишите на C# функцию, определяющую, является ли число 407 простым. ### Response: public bool IsPrime() { int n = 407; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
1,142,779
kk
JavaScript
var_decl
beginner
JavaScript тілінде 518088 мәнімен y айнымалысын қалай жариялауға болады?
let y = 518088;
### Instruction: JavaScript тілінде 518088 мәнімен y айнымалысын қалай жариялауға болады? ### Response: let y = 518088;
2,532,913
kk
JavaScript
var_decl
beginner
JavaScript тілінде 79372 мәнімен speed айнымалысын қалай жариялауға болады?
let speed = 79372;
### Instruction: JavaScript тілінде 79372 мәнімен speed айнымалысын қалай жариялауға болады? ### Response: let speed = 79372;
25,285,007
en
Python
logic_ops
advanced
Write a function that determines if the number 364 is prime in Python.
def is_prime(): n = 364 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
### Instruction: Write a function that determines if the number 364 is prime in Python. ### Response: def is_prime(): n = 364 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
65,404,347
kk
C++
string_ops
intermediate
C++ тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз.
public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
### Instruction: C++ тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз. ### Response: public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
54,511,638
en
Python
array_ops
advanced
Write a function that filters only even numbers from a list in Python.
def filter_even(arr): return [x for x in arr if x % 2 == 0]
### Instruction: Write a function that filters only even numbers from a list in Python. ### Response: def filter_even(arr): return [x for x in arr if x % 2 == 0]
2,555,434
en
JavaScript
var_decl
beginner
How to declare a variable limit with value 639041 in JavaScript?
let limit = 639041;
### Instruction: How to declare a variable limit with value 639041 in JavaScript? ### Response: let limit = 639041;
72,339,149
en
Unity
array_ops
advanced
Write a function that reverses a list in Unity.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: Write a function that reverses a list in Unity. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
3,918,575
ru
C++
var_decl
beginner
Как объявить переменную offset со значением 73237 в C++?
int offset = 73237;
### Instruction: Как объявить переменную offset со значением 73237 в C++? ### Response: int offset = 73237;
1,091,660
en
Java
var_decl
beginner
How to declare a variable score with value 938873 in Java?
int score = 938873;
### Instruction: How to declare a variable score with value 938873 in Java? ### Response: int score = 938873;
54,261,331
ru
C#
array_ops
advanced
Напишите на C# функцию, которая фильтрует только четные числа из списка.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: Напишите на C# функцию, которая фильтрует только четные числа из списка. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
16,481,239
ru
Java
logic_ops
advanced
Напишите на Java логику проверки, является ли год 2015 високосным.
public bool IsLeap() { int y = 2015; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на Java логику проверки, является ли год 2015 високосным. ### Response: public bool IsLeap() { int y = 2015; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
59,375,650
en
C#
string_ops
advanced
Write a function that checks if a string is a palindrome in C#.
public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
### Instruction: Write a function that checks if a string is a palindrome in C#. ### Response: public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
27,438,322
en
C++
string_ops
advanced
Write a function that converts a string to uppercase in C++.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Write a function that converts a string to uppercase in C++. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
86,361,333
en
JavaScript
string_ops
intermediate
Write a function that checks if a string is a palindrome in JavaScript.
const isPalindrome = s => s === s.split('').reverse().join('');
### Instruction: Write a function that checks if a string is a palindrome in JavaScript. ### Response: const isPalindrome = s => s === s.split('').reverse().join('');
579,536
ru
Unity
sum_n
intermediate
Напиши функцию на Unity, которая считает сумму чисел от 1 до 9040.
int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } void Start() { Debug.Log(SumToN(9040)); }
### Instruction: Напиши функцию на Unity, которая считает сумму чисел от 1 до 9040. ### Response: int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } void Start() { Debug.Log(SumToN(9040)); }
11,495,872
en
C#
string_ops
intermediate
Write a function that checks if a string is a palindrome in C#.
public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
### Instruction: Write a function that checks if a string is a palindrome in C#. ### Response: public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
54,926,617
en
Unity
string_ops
advanced
Write a function that converts a string to uppercase in Unity.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Write a function that converts a string to uppercase in Unity. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
1,511,466
kk
Python
var_decl
beginner
Python тілінде 405133 мәнімен count айнымалысын қалай жариялауға болады?
count = 405133
### Instruction: Python тілінде 405133 мәнімен count айнымалысын қалай жариялауға болады? ### Response: count = 405133
88,057,949
en
C++
logic_ops
intermediate
Write logic to check if the year 2100 is a leap year in C++.
public bool IsLeap() { int y = 2100; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 2100 is a leap year in C++. ### Response: public bool IsLeap() { int y = 2100; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
50,723,608
kk
C#
logic_ops
advanced
C# тилінде 1907 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
public bool IsLeap() { int y = 1907; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: C# тилінде 1907 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: public bool IsLeap() { int y = 1907; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
52,610,091
en
Java
array_ops
intermediate
Write a function that finds the maximum number in an array in Java.
public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
### Instruction: Write a function that finds the maximum number in an array in Java. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
79,770,155
kk
C++
string_ops
intermediate
C++ тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз.
public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
### Instruction: C++ тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз. ### Response: public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
18,739,680
kk
C#
string_ops
intermediate
C# тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз.
public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
### Instruction: C# тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз. ### Response: public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
55,305,789
en
JavaScript
logic_ops
advanced
Write a function that determines if the number 384 is prime in JavaScript.
function isPrime() { let n = 384; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
### Instruction: Write a function that determines if the number 384 is prime in JavaScript. ### Response: function isPrime() { let n = 384; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }