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
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
import 'dart:math' as math; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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
import 'package:flutter/material.dart'; | |
void main() => runApp(MyWeatherApp()); | |
class MyWeatherApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
backgroundColor: Colors.red, |
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
import 'package:flutter/material.dart'; | |
void main() => runApp(MyCounterApp()); | |
class MyCounterApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
backgroundColor: Colors.blue[300], |
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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
Center( | |
child: Text( | |
'Hello Flutter', | |
style: TextStyle( | |
fontSize: 40, | |
color: Colors.red, |
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
/* | |
Задача. | |
Определите следующие классы. | |
1) Кубоид | |
Конструктор объекта для класса Cuboid должен получить ровно три аргумента в следующем порядке: длина, ширина, высота и сохранить эти три значения в length, width и height соответственно. | |
Класс Cuboid должен иметь геттер SurfaceArea, который возвращает площадь поверхности кубоида, и геттер Volume, который возвращает объем кубоида. |
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
/* | |
Задача 2. | |
Вы получите список чисел. Ваша задача вернуть сумму всех положительных чисел. | |
Пример: [1, -10, 9, -1] => 1 + 9 = 10 | |
Условия: | |
1. Список может быть пустым, в этом случае возвращаем 0. | |
2. Если в списке все отрицательные значения, то вернуть 0. | |
Входные данные: | |
[1, -10, 9, -1] |
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
/* | |
Задача 1. | |
Вы получите список строк. Ваша задача вернуть сумму длинны всех строк в списке. | |
Пример: [“a”, “ab”, “abc”] => 1 + 2 + 3 = 6 | |
Условия: | |
1. Список может быть пустым, в этом случае возвращаем 0. | |
Входные данные: | |
[“a”, “ab”, “abc”] | |
[“abcde”, “ab”, “abc”] |
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
/* | |
Задача | |
Вам дана строка «abc» и предполагая, что каждая буква в строке имеет значение, равное ее позиции в алфавите, то наша строка будет иметь значение 1 + 2 + 3 = 6. Это означает, что: a = 1, b = 2, c = 3 .... z = 26. | |
Вам будет предоставлен список строк, и ваша задача будет вернуть значения строк, умноженные на позицию этой строки в списке. Позиция начинается с 1. | |
Например: wordValue ["abc", "abc abc"] должно вернуть [6, 24] или [6 * 1, 12 * 2]. Обратите внимание, что пробелы игнорируются. «abc» имеет значение 6, а «abc abc» - значение 12. Теперь значение в позиции 1 умножается на 1, а значение в позиции 2 умножается на 2. Ввод будет содержать только строчные буквы и пробелы. | |
Входные данные: |
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() { | |
/* | |
Задача | |
Вам будет дан список (list) и значение (value). Все, что вам нужно сделать, это проверить, содержит ли предоставленный список данное значение. | |
Список может содержать числа или строки. Value должно возвращать true, если список содержит значение, и false, если нет. Запрещено использовать indexOf. | |
Входные данные: |
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() { | |
/* | |
Задача 3 | |
Вам будет дан год, верните тот век, в котором он находится. Первый век охватывает период с 1 года до 100 года включительно, второй - с 101 года до 200 года включительно и т. д. | |
Входные данные:1705,1900,1601,2000 | |
Выходные данные:18,19,17,20 | |
*/ | |
var years = [1705, 1900, 1601, 2000]; | |
for (int i = 0; i < years.length; i++) { |
NewerOlder