This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final x = 8; | |
final y = 10; | |
int c = sum(x, y); | |
print("$x + $y = $c"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final numbers = <int>[10, 5, 1, 99, 12, 44]; | |
print("Минимальное чило = ${searchMin(numbers)}"); | |
} | |
int searchMin(List<int> numbers) { | |
int min = numbers[0]; | |
for (int i = 0; i < numbers.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final numbers = <int>[1, 5, 3, 99, 12, 44]; | |
List<List<int>> evenAndOdd= searchEvenAndOdd(numbers); | |
print("Четные числа = ${evenAndOdd[0]}"); | |
print("Нечетные числа = ${evenAndOdd[1]}"); | |
} | |
List<List<int>> searchEvenAndOdd(List<int> numbers) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
String? x; | |
String? y = 'abc'; | |
printNullable(x); | |
printNullable(y); | |
} | |
void printNullable(String? nullableString){ | |
if (nullableString != null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final String? a = null; | |
final String? b = "Hello World"; | |
print(lengthString(a)); | |
print(lengthString(b)); | |
} | |
int? lengthString(String? str) => str?.length ?? 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
late String a; | |
a = "abc"; | |
print("Моя строка $a"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
Person person1 = Person(name: 'Иван Иванов', age: 25, gender: Gender.male); | |
Person person2 = Person(name: 'Петр Петров', age: 22, gender: Gender.male); | |
Person person3 = Person(name: 'Марина Валентиновна', age: 40, gender: Gender.female); | |
print(person1); | |
print(person2); | |
print(person3); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
Person person1 = Person(name: 'Иван Иванов', age: 25, gender: Gender.male); | |
Person person2 = Person(name: 'Петр Петров', age: 22, gender: Gender.male); | |
Person person3 = Person(name: 'Марина Валентиновна', age: 40, gender: Gender.female); | |
print(person1.personName); | |
person1.age = 26; | |
print(person1.personAge); | |
print(person1.personGender.hex); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
// Person person1 = Person(name: 'Иван Иванов', age: 25, gender: Gender.male); | |
// Person person2 = Person(name: 'Петр Петров', age: 22, gender: Gender.male); | |
// Person person3 = Person(name: 'Марина Валентиновна', age: 40, gender: Gender.female); | |
StudentsGroup group1 = StudentsGroup(recruitmentYear: 2023, name: 'АА-00'); | |
StudentsGroup group2 = StudentsGroup(recruitmentYear: 2022, name: 'AA-01'); | |
print(group1); | |
print(group2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
Person person1 = Person(name: 'Иван Иванов', age: 25, gender: Gender.male); | |
Person person2 = Person(name: 'Петр Петров', age: 22, gender: Gender.male); | |
Person person3 = Person(name: 'Марина Валентиновна', age: 40, gender: Gender.female); | |
Person person4 = Person(name: 'Екатерина Сидорова', age: 21, gender: Gender.female,); | |
Person person5 = Person(name: 'Александр Иванов', age: 23, gender: Gender.male); | |
StudentsGroup group1 = StudentsGroup(recruitmentYear: 2023, name: 'АА-00'); | |
StudentsGroup group2 = StudentsGroup(recruitmentYear: 2022, name: 'AA-01'); | |
StudentsGroup group3 = StudentsGroup(recruitmentYear: 2022, name: 'AB-02'); |
OlderNewer