Last active
August 1, 2020 20:34
-
-
Save Medvedoc/2cfe0a0a39f4eb1afded2868d1f5e13e to your computer and use it in GitHub Desktop.
My_tasks_Dart
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() { | |
| /* | |
| Задача 1 | |
| Напишите программу, которая выводит на экран числа от 1 до 100. При этом вместо чисел, кратных трем, программа должна выводить слово «Super», а вместо чисел, кратных пяти — слово «Quiz». Если число кратно и 3, и 5, то программа должна выводить слово «Super Quiz» | |
| */ | |
| //Задание 1 | |
| for (int m=1; m<=100;m++){ | |
| if (m%3==0 && m%5==0){ | |
| print('Super Quiz'); | |
| } else if (m%3==0) { | |
| print('Super'); | |
| } else if (m%5==0){ | |
| print('Quiz'); | |
| } else { | |
| print('$m'); | |
| } | |
| } | |
| } | |
| //Подсказки | |
| // % - Получить остаток от целочисленного деления |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment