Цикл while, с вводом и двумя if | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Цикл while, с вводом и двумя if

Помогите починить код. Суть в том, что input должен быть внутри while, чтобы при вводе любого числа оно сначала складывалось с единицой в одном if, после выходило из него, попадая в другой и там, если введеное число - а, то складывало 2+а. После этого код должен начаться сначала и запросить новое число на ввод. https://code.sololearn.com/cZjNgUc5xp9H/?ref=app

15th Sep 2017, 5:38 PM
Ярослав Ульянов
Ярослав Ульянов - avatar
1 Answer
+ 9
bt { While loop, with input and 2 if Help me fix the code. The point is, that input must be within a while, so that when you enter any number, it first increments with a unit in one if, then exits when it enters the other, and then, if the number is-a, then Skladyvalo 2 + A. The code must begin first and request The new number to enter. } https://www.sololearn.com/discuss/333866/?ref=app
15th Sep 2017, 5:52 PM
Lord Krishna
Lord Krishna - avatar