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
158,097
kk
C#
sum_n
intermediate
C# тілінде 1-ден 2181-ге дейінгі сандардың қосындысын есептейтін функция жаз.
static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(2181));
### Instruction: C# тілінде 1-ден 2181-ге дейінгі сандардың қосындысын есептейтін функция жаз. ### Response: static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(2181));
18,215,054
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; }
244,108
kk
Java
sum_n
intermediate
Java тілінде 1-ден 4891-ге дейінгі сандардың қосындысын есептейтін функция жаз.
static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(4891));
### Instruction: Java тілінде 1-ден 4891-ге дейінгі сандардың қосындысын есептейтін функция жаз. ### Response: static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(4891));
39,178,006
kk
Python
logic_ops
advanced
Python тилінде 1924 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
def is_leap(): year = 1924 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
### Instruction: Python тилінде 1924 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: def is_leap(): year = 1924 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
88,906,928
ru
Python
logic_ops
advanced
Напишите на Python логику проверки, является ли год 2095 високосным.
def is_leap(): year = 2095 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
### Instruction: Напишите на Python логику проверки, является ли год 2095 високосным. ### Response: def is_leap(): year = 2095 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
54,208,268
ru
C#
string_ops
advanced
Напишите на 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; }
403,985
en
Unity
sum_n
intermediate
Write a function in Unity that sums numbers from 1 to 5523.
int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } void Start() { Debug.Log(SumToN(5523)); }
### Instruction: Write a function in Unity that sums numbers from 1 to 5523. ### Response: int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } void Start() { Debug.Log(SumToN(5523)); }
27,322,449
ru
Java
string_ops
advanced
Напишите на 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; }
70,187,851
en
JavaScript
string_ops
intermediate
Write a function that converts a string to uppercase in JavaScript.
const toUpper = s => s.toUpperCase();
### Instruction: Write a function that converts a string to uppercase in JavaScript. ### Response: const toUpper = s => s.toUpperCase();
45,453,076
kk
Java
string_ops
advanced
Java тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Java тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
92,290,442
kk
C#
logic_ops
intermediate
C# тилінде 1931 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
public bool IsLeap() { int y = 1931; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: C# тилінде 1931 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: public bool IsLeap() { int y = 1931; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
55,428,970
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); }
3,556,787
kk
C++
var_decl
beginner
C++ тілінде 256180 мәнімен timer айнымалысын қалай жариялауға болады?
int timer = 256180;
### Instruction: C++ тілінде 256180 мәнімен timer айнымалысын қалай жариялауға болады? ### Response: int timer = 256180;
3,386,922
kk
Unity
var_decl
beginner
Unity тілінде 186002 мәнімен limit айнымалысын қалай жариялауға болады?
int limit = 186002;
### Instruction: Unity тілінде 186002 мәнімен limit айнымалысын қалай жариялауға болады? ### Response: int limit = 186002;
28,175,792
kk
Unity
string_ops
advanced
Unity тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз.
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: Unity тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз. ### 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; }
79,896,833
kk
C#
string_ops
advanced
C# тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: C# тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
56,213,927
ru
Python
string_ops
intermediate
Напишите на Python функцию, которая переводит строку в верхний регистр.
def to_upper(s): return s.upper()
### Instruction: Напишите на Python функцию, которая переводит строку в верхний регистр. ### Response: def to_upper(s): return s.upper()
251,647
kk
C++
sum_n
intermediate
C++ тілінде 1-ден 7861-ге дейінгі сандардың қосындысын есептейтін функция жаз.
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(7861) << std::endl;
### Instruction: C++ тілінде 1-ден 7861-ге дейінгі сандардың қосындысын есептейтін функция жаз. ### 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(7861) << std::endl;
4,036,301
en
Python
var_decl
beginner
How to declare a variable health with value 958071 in Python?
health = 958071
### Instruction: How to declare a variable health with value 958071 in Python? ### Response: health = 958071
4,284,992
kk
Unity
var_decl
beginner
Unity тілінде 264314 мәнімен health айнымалысын қалай жариялауға болады?
int health = 264314;
### Instruction: Unity тілінде 264314 мәнімен health айнымалысын қалай жариялауға болады? ### Response: int health = 264314;
10,696,941
en
JavaScript
array_ops
advanced
Write a function that reverses a list in JavaScript.
const reverseArr = arr => arr.reverse();
### Instruction: Write a function that reverses a list in JavaScript. ### Response: const reverseArr = arr => arr.reverse();
52,799,725
ru
Java
logic_ops
advanced
Напишите на Java логику проверки, является ли год 2048 високосным.
public bool IsLeap() { int y = 2048; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на Java логику проверки, является ли год 2048 високосным. ### Response: public bool IsLeap() { int y = 2048; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
36,730,174
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); }
64,156,061
kk
Python
string_ops
intermediate
Python тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз.
def count_vowels(s): return sum(1 for c in s if c in 'aeiouAEIOUаеёиоуыэюя')
### Instruction: Python тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз. ### Response: def count_vowels(s): return sum(1 for c in s if c in 'aeiouAEIOUаеёиоуыэюя')
53,535,950
en
JavaScript
array_ops
advanced
Write a function that filters only even numbers from a list in JavaScript.
const filterEven = arr => arr.filter(x => x % 2 === 0);
### Instruction: Write a function that filters only even numbers from a list in JavaScript. ### Response: const filterEven = arr => arr.filter(x => x % 2 === 0);
1,884,957
ru
JavaScript
var_decl
beginner
Как объявить переменную amount со значением 698566 в JavaScript?
let amount = 698566;
### Instruction: Как объявить переменную amount со значением 698566 в JavaScript? ### Response: let amount = 698566;
4,904,193
ru
Unity
var_decl
beginner
Как объявить переменную count со значением 733398 в Unity?
int count = 733398;
### Instruction: Как объявить переменную count со значением 733398 в Unity? ### Response: int count = 733398;
71,127
en
Java
sum_n
intermediate
Write a function in Java that sums numbers from 1 to 8907.
static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(8907));
### Instruction: Write a function in Java that sums numbers from 1 to 8907. ### Response: static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(8907));
71,878,897
kk
C++
string_ops
advanced
C++ тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: C++ тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
2,645,746
ru
C++
var_decl
beginner
Как объявить переменную rate со значением 518606 в C++?
int rate = 518606;
### Instruction: Как объявить переменную rate со значением 518606 в C++? ### Response: int rate = 518606;
25,242,222
kk
Java
logic_ops
intermediate
Java тилінде 8 санының жай сан екенін анықтайтын функцияны жазыңыз.
public bool IsPrime() { int n = 8; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Java тилінде 8 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: public bool IsPrime() { int n = 8; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
525,099
kk
C++
factorial
advanced
C++ тілінде 553 санының факториалын есептейтін функция жаз.
long long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } std::cout << factorial(553) << std::endl;
### Instruction: C++ тілінде 553 санының факториалын есептейтін функция жаз. ### Response: long long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } std::cout << factorial(553) << std::endl;
63,701,505
en
C#
string_ops
intermediate
Write a function that counts vowels in a text in C#.
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 C#. ### Response: public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
63,998,892
kk
JavaScript
array_ops
intermediate
JavaScript тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз.
const filterEven = arr => arr.filter(x => x % 2 === 0);
### Instruction: JavaScript тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз. ### Response: const filterEven = arr => arr.filter(x => x % 2 === 0);
794,725
kk
Unity
factorial
advanced
Unity тілінде 6536 санының факториалын есептейтін функция жаз.
long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } void Start() { Debug.Log(Factorial(6536)); }
### Instruction: Unity тілінде 6536 санының факториалын есептейтін функция жаз. ### Response: long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } void Start() { Debug.Log(Factorial(6536)); }
97,394,474
ru
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; }
1,656,277
en
Python
var_decl
beginner
How to declare a variable amount with value 54857 in Python?
amount = 54857
### Instruction: How to declare a variable amount with value 54857 in Python? ### Response: amount = 54857
32,236,306
en
Unity
logic_ops
intermediate
Write a function that determines if the number 450 is prime in Unity.
public bool IsPrime() { int n = 450; 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 450 is prime in Unity. ### Response: public bool IsPrime() { int n = 450; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
296,242
en
Java
sum_n
intermediate
Write a function in Java that sums numbers from 1 to 8732.
static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(8732));
### Instruction: Write a function in Java that sums numbers from 1 to 8732. ### Response: static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(8732));
331,168
en
C++
sum_n
intermediate
Write a function in C++ that sums numbers from 1 to 1135.
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(1135) << std::endl;
### Instruction: Write a function in C++ that sums numbers from 1 to 1135. ### 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(1135) << std::endl;
469,358
ru
C#
var_decl
beginner
Как объявить переменную rate со значением 209357 в C#?
int rate = 209357;
### Instruction: Как объявить переменную rate со значением 209357 в C#? ### Response: int rate = 209357;
4,022,930
kk
Unity
var_decl
beginner
Unity тілінде 889033 мәнімен total айнымалысын қалай жариялауға болады?
int total = 889033;
### Instruction: Unity тілінде 889033 мәнімен total айнымалысын қалай жариялауға болады? ### Response: int total = 889033;
29,844,579
kk
C#
array_ops
intermediate
C# тилінде тізімді керісінше айналдыратын функцияны жазыңыз.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: C# тилінде тізімді керісінше айналдыратын функцияны жазыңыз. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
675,785
ru
C++
var_decl
beginner
Как объявить переменную result со значением 29993 в C++?
int result = 29993;
### Instruction: Как объявить переменную result со значением 29993 в C++? ### Response: int result = 29993;
54,255,866
kk
C++
array_ops
intermediate
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; }
38,400,448
kk
Unity
string_ops
intermediate
Unity тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз.
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: Unity тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз. ### 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; }
356,180
en
Java
sum_n
intermediate
Write a function in Java that sums numbers from 1 to 5039.
static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(5039));
### Instruction: Write a function in Java that sums numbers from 1 to 5039. ### Response: static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(5039));
68,188,160
kk
JavaScript
logic_ops
intermediate
JavaScript тилінде 51 санының жай сан екенін анықтайтын функцияны жазыңыз.
function isPrime() { let n = 51; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
### Instruction: JavaScript тилінде 51 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: function isPrime() { let n = 51; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
1,889,342
kk
Unity
var_decl
beginner
Unity тілінде 850898 мәнімен level айнымалысын қалай жариялауға болады?
int level = 850898;
### Instruction: Unity тілінде 850898 мәнімен level айнымалысын қалай жариялауға болады? ### Response: int level = 850898;
57,593,695
kk
Java
logic_ops
intermediate
Java тилінде 2013 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
public bool IsLeap() { int y = 2013; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Java тилінде 2013 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: public bool IsLeap() { int y = 2013; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
51,456,027
en
Python
logic_ops
advanced
Write a function that determines if the number 3 is prime in Python.
def is_prime(): n = 3 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 3 is prime in Python. ### Response: def is_prime(): n = 3 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
44,948,285
kk
C++
array_ops
intermediate
C++ тилінде тізімді керісінше айналдыратын функцияны жазыңыз.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: C++ тилінде тізімді керісінше айналдыратын функцияны жазыңыз. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
2,684,520
ru
C++
var_decl
beginner
Как объявить переменную size со значением 3340 в C++?
int size = 3340;
### Instruction: Как объявить переменную size со значением 3340 в C++? ### Response: int size = 3340;
87,221,350
en
Java
logic_ops
intermediate
Write logic to check if the year 1988 is a leap year in Java.
public bool IsLeap() { int y = 1988; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 1988 is a leap year in Java. ### Response: public bool IsLeap() { int y = 1988; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
35,293,249
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; }
3,610,235
ru
Java
var_decl
beginner
Как объявить переменную score со значением 924696 в Java?
int score = 924696;
### Instruction: Как объявить переменную score со значением 924696 в Java? ### Response: int score = 924696;
96,071,051
en
JavaScript
array_ops
advanced
Write a function that reverses a list in JavaScript.
const reverseArr = arr => arr.reverse();
### Instruction: Write a function that reverses a list in JavaScript. ### Response: const reverseArr = arr => arr.reverse();
73,914,629
ru
Python
array_ops
intermediate
Напишите на 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]
15,314,143
en
JavaScript
array_ops
advanced
Write a function that filters only even numbers from a list in JavaScript.
const filterEven = arr => arr.filter(x => x % 2 === 0);
### Instruction: Write a function that filters only even numbers from a list in JavaScript. ### Response: const filterEven = arr => arr.filter(x => x % 2 === 0);
3,569,604
ru
C#
var_decl
beginner
Как объявить переменную total со значением 49586 в C#?
int total = 49586;
### Instruction: Как объявить переменную total со значением 49586 в C#? ### Response: int total = 49586;
26,175,766
ru
Java
logic_ops
intermediate
Напишите на Java логику проверки, является ли год 1901 високосным.
public bool IsLeap() { int y = 1901; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на Java логику проверки, является ли год 1901 високосным. ### Response: public bool IsLeap() { int y = 1901; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
88,375,450
ru
Unity
logic_ops
intermediate
Напишите на Unity функцию, определяющую, является ли число 268 простым.
public bool IsPrime() { int n = 268; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Напишите на Unity функцию, определяющую, является ли число 268 простым. ### Response: public bool IsPrime() { int n = 268; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
169,657
kk
Unity
sum_n
intermediate
Unity тілінде 1-ден 2336-ге дейінгі сандардың қосындысын есептейтін функция жаз.
int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } void Start() { Debug.Log(SumToN(2336)); }
### Instruction: Unity тілінде 1-ден 2336-ге дейінгі сандардың қосындысын есептейтін функция жаз. ### Response: int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } void Start() { Debug.Log(SumToN(2336)); }
974,043
ru
Python
sum_n
intermediate
Напиши функцию на Python, которая считает сумму чисел от 1 до 9952.
def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(9952))
### Instruction: Напиши функцию на Python, которая считает сумму чисел от 1 до 9952. ### Response: def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(9952))
2,978,878
ru
Unity
var_decl
beginner
Как объявить переменную speed со значением 37795 в Unity?
int speed = 37795;
### Instruction: Как объявить переменную speed со значением 37795 в Unity? ### Response: int speed = 37795;
57,893,465
en
C#
array_ops
advanced
Write a function that finds the maximum number in an array in C#.
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 C#. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
147,561
ru
C#
factorial
advanced
Напиши функцию на C#, которая вычисляет факториал числа 7542.
static long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } Console.WriteLine(Factorial(7542));
### Instruction: Напиши функцию на C#, которая вычисляет факториал числа 7542. ### Response: static long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } Console.WriteLine(Factorial(7542));
946,146
kk
C#
var_decl
beginner
C# тілінде 891682 мәнімен data айнымалысын қалай жариялауға болады?
int data = 891682;
### Instruction: C# тілінде 891682 мәнімен data айнымалысын қалай жариялауға болады? ### Response: int data = 891682;
34,100,200
en
Java
string_ops
advanced
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; }
64,977,391
kk
Python
logic_ops
intermediate
Python тилінде 419 санының жай сан екенін анықтайтын функцияны жазыңыз.
def is_prime(): n = 419 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
### Instruction: Python тилінде 419 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: def is_prime(): n = 419 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
63,149,796
en
C++
array_ops
intermediate
Write a function that reverses a list in C++.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: Write a function that reverses a list in C++. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
3,641,184
en
C#
var_decl
beginner
How to declare a variable total with value 25153 in C#?
int total = 25153;
### Instruction: How to declare a variable total with value 25153 in C#? ### Response: int total = 25153;
41,923,757
kk
Unity
string_ops
intermediate
Unity тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Unity тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
82,671,032
ru
JavaScript
array_ops
intermediate
Напишите на JavaScript функцию, которая фильтрует только четные числа из списка.
const filterEven = arr => arr.filter(x => x % 2 === 0);
### Instruction: Напишите на JavaScript функцию, которая фильтрует только четные числа из списка. ### Response: const filterEven = arr => arr.filter(x => x % 2 === 0);
89,395,654
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(); }
90,563,271
kk
Python
logic_ops
advanced
Python тилінде 2064 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
def is_leap(): year = 2064 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
### Instruction: Python тилінде 2064 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: def is_leap(): year = 2064 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
33,418,145
kk
Python
logic_ops
intermediate
Python тилінде 288 санының жай сан екенін анықтайтын функцияны жазыңыз.
def is_prime(): n = 288 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
### Instruction: Python тилінде 288 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: def is_prime(): n = 288 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
1,797,139
kk
C++
var_decl
beginner
C++ тілінде 458202 мәнімен y айнымалысын қалай жариялауға болады?
int y = 458202;
### Instruction: C++ тілінде 458202 мәнімен y айнымалысын қалай жариялауға болады? ### Response: int y = 458202;
52,350,068
kk
C++
logic_ops
intermediate
C++ тилінде 1973 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
public bool IsLeap() { int y = 1973; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: C++ тилінде 1973 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: public bool IsLeap() { int y = 1973; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
1,568,635
ru
Unity
var_decl
beginner
Как объявить переменную size со значением 189101 в Unity?
int size = 189101;
### Instruction: Как объявить переменную size со значением 189101 в Unity? ### Response: int size = 189101;
356,475
kk
C#
sum_n
intermediate
C# тілінде 1-ден 8189-ге дейінгі сандардың қосындысын есептейтін функция жаз.
static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(8189));
### Instruction: C# тілінде 1-ден 8189-ге дейінгі сандардың қосындысын есептейтін функция жаз. ### Response: static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(8189));
4,248,704
ru
C++
var_decl
beginner
Как объявить переменную weight со значением 988119 в C++?
int weight = 988119;
### Instruction: Как объявить переменную weight со значением 988119 в C++? ### Response: int weight = 988119;
2,277,765
ru
JavaScript
var_decl
beginner
Как объявить переменную offset со значением 485680 в JavaScript?
let offset = 485680;
### Instruction: Как объявить переменную offset со значением 485680 в JavaScript? ### Response: let offset = 485680;
1,763,259
ru
C#
var_decl
beginner
Как объявить переменную amount со значением 842281 в C#?
int amount = 842281;
### Instruction: Как объявить переменную amount со значением 842281 в C#? ### Response: int amount = 842281;
19,879,815
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; }
3,319,178
ru
Unity
var_decl
beginner
Как объявить переменную x со значением 742887 в Unity?
int x = 742887;
### Instruction: Как объявить переменную x со значением 742887 в Unity? ### Response: int x = 742887;
15,487,486
kk
JavaScript
string_ops
intermediate
JavaScript тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз.
const countVowels = s => (s.match(/[aeiou]/gi) || []).length;
### Instruction: JavaScript тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз. ### Response: const countVowels = s => (s.match(/[aeiou]/gi) || []).length;
26,355,004
ru
Unity
array_ops
intermediate
Напишите на 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; }
3,221,108
ru
C#
var_decl
beginner
Как объявить переменную limit со значением 430955 в C#?
int limit = 430955;
### Instruction: Как объявить переменную limit со значением 430955 в C#? ### Response: int limit = 430955;
12,498,187
en
Java
string_ops
advanced
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; }
10,914,519
kk
Python
string_ops
advanced
Python тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
def to_upper(s): return s.upper()
### Instruction: Python тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: def to_upper(s): return s.upper()
13,774,930
ru
C#
string_ops
intermediate
Напишите на C# функцию, которая переводит строку в верхний регистр.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Напишите на C# функцию, которая переводит строку в верхний регистр. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
36,986,203
en
Python
string_ops
advanced
Write a function that counts vowels in a text in Python.
def count_vowels(s): return sum(1 for c in s if c in 'aeiouAEIOUаеёиоуыэюя')
### Instruction: Write a function that counts vowels in a text in Python. ### Response: def count_vowels(s): return sum(1 for c in s if c in 'aeiouAEIOUаеёиоуыэюя')
42,054,292
kk
JavaScript
logic_ops
intermediate
JavaScript тилінде 101 санының жай сан екенін анықтайтын функцияны жазыңыз.
function isPrime() { let n = 101; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
### Instruction: JavaScript тилінде 101 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: function isPrime() { let n = 101; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
2,844,867
en
Unity
var_decl
beginner
How to declare a variable health with value 442763 in Unity?
int health = 442763;
### Instruction: How to declare a variable health with value 442763 in Unity? ### Response: int health = 442763;
86,573,904
ru
Unity
array_ops
intermediate
Напишите на 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; }
3,565,222
ru
C#
var_decl
beginner
Как объявить переменную x со значением 997497 в C#?
int x = 997497;
### Instruction: Как объявить переменную x со значением 997497 в C#? ### Response: int x = 997497;
3,298,363
kk
JavaScript
var_decl
beginner
JavaScript тілінде 441650 мәнімен x айнымалысын қалай жариялауға болады?
let x = 441650;
### Instruction: JavaScript тілінде 441650 мәнімен x айнымалысын қалай жариялауға болады? ### Response: let x = 441650;
46,489,491
en
Unity
array_ops
intermediate
Write a function that filters only even numbers from a list in 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: Write a function that filters only even numbers from a list in 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; }
3,254,775
en
Java
var_decl
beginner
How to declare a variable count with value 986283 in Java?
int count = 986283;
### Instruction: How to declare a variable count with value 986283 in Java? ### Response: int count = 986283;