Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication2.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <vector>
- #include "string.h"
- #include <cstdlib>
- class neyron {
- public:
- neyron()
- {
- }
- neyron(std::string name, float weight)
- {
- this->setValue(name, weight);
- }
- void setValue(std::string name, float weight) {
- this->NAME = name;
- this->WEIGHT = weight;
- }
- std::string getName()
- {
- return this->NAME;
- }
- float getWeight() {
- return this->WEIGHT;
- }
- private:
- std::string NAME;
- float WEIGHT;
- };
- class neyronsList {
- public:
- neyronsList()
- {
- }
- int addValue(std::string name, float weight) {
- Base.push_back(*new neyron(name, weight));
- return this->getSize();
- }
- int getSize() {
- return Base.size();
- }
- neyron getValue(int index) {
- return Base[index];
- }
- private:
- std::vector<neyron> Base;
- };
- int main() {
- neyronsList *WORKER;
- WORKER = new neyronsList();
- WORKER->addValue("HERON", 6.34635);
- printf("%f", WORKER->getValue(0).getWeight());
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment