Задача "Проверь себя"!(с++)
You are given an positive integer number n. Count the amount of the lucky and almost lucky numbers
from one until n (inclusive).
The number is considered to be lucky if it is divided to 7 without a remainder.
The number is considered to be almost lucky if it is divided to 7 with a remainder of 2.
Count the amount of the lucky and almost lucky numbers from one until n (inclusive) !!!
Вам дается положительное целое число n. Подсчитайте количество удачливых и почти счастливых номеров
от одного до n (включительно).
Число считается удачным, если оно делится на 7 без остатка.
Число считается почти счастливым, если оно разделено на 7 с остатком 2.
Подсчитайте количество удачливых и почти счастливых чисел от одного до n (включительно) !!!
Input1: 10 Input2: 7 Input 3: 1
Output1: 3 Output2: 2 Output3: 0
|