Вот http://pastebin.com/x5kVbW2DПодредактируй ввод вывод.или вот#include<bits/stdc++.h>using namespace std;const int N = 1024+3; //size of "RAM"vector<pair<bool, int> > ram(N); //ramint get_area(int n){ for (int i = 0; i < N-n-1 ; i ++) { if(ram[i].first == false) { int j; for (j = i; j < i+n ; j ++ ) if(ram[j].first == true) break; if (ram[j].first == true) { i = j; continue; } for(j = i ; j < i+n ; j ++) { ram[j].first = true; ram[j].second = i; } return i; } } return -1;}string del_area(int n){ int j = n; for(int i = n ; ram[j].second == ram[i].second && i < N-1; i ++) { ram[i].first = false; ram[i].second = 0; } return "Success! Area deleted!";}int get_status(){ cout << endl << "Byte using of 1024 RAM:" << endl; for(int i = 0 ; i < N-2 ; i ++) { if(ram[i].first == false) cout << "-" << ' '; else cout << ram[i].second << ' '; }}int main(){ ///code by Dmitry Kulazhenko (DmitryCpp) ///ram index begins at 0 ///give area of RAM, size n get_area enter n ///delete area, with start index n del_area enter n ///give status of using RAM get_status ///to quit exit string s; while( s != "exit" ) { cin >> s; if (s == "get_area") { int n; cin >> n; cout << get_area(n); cout << endl; } if (s == "del_area") { int n; cin >> n; cout << del_area(n); cout << endl; } if (s == "get_status") { cout << get_status(); cout << endl; } } return 0;}