Nice try, but it isnt a C++ solution worth its name. You need more structure like with classes, structs and functions. It is used to gain some
clean code for beginners. Be aware that your homework will be read by your teacher or tutor and he doesnt may not understand your bizzare code at first.
You also misses
ANY user input and output. That is a severe architectural flaw.
You need to learn about
Structs in C++. Get clear whether you should use classes or structs. The main difference is that classes have member functions on top of storing only data.
Tip: write small functions and use tests to verify their correctness.