Вопрос по массиву | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

Вопрос по массиву

Как сделать, чтобы при выборе разных переменных массива к переменным x и y присваивались определённые значения. Например если m1 то x=100 y=70, m2 то x=109 y=77 Спасибо заранее https://code.sololearn.com/cFzE8aGn8AAQ/?ref=app

26th Feb 2019, 7:24 PM
Андрей Бабурин
Андрей Бабурин - avatar
2 Antworten
+ 2
You mean like this ? https://code.sololearn.com/crYiD4lY9JOs These are called parrallel array's. Where you make you sure that the same indexes contain the value that belong together. This is the simplest way to do it, but is is vulnerable to bugs. If you really want to do this. Learn to make a class, objects and collections.
26th Feb 2019, 8:56 PM
sneeze
sneeze - avatar
+ 2
Большое спасибо.
27th Feb 2019, 2:41 AM
Андрей Бабурин
Андрей Бабурин - avatar