#include <iostream>

using namespace std;



int main()
{
    int pos;
    char *name = NULL;
    int *one = NULL;
    int *two = NULL;
    int *three = NULL;
    int result;
	int MAXNAME;
	
	cout<<"How many characters you want to enter ? \n";
	cin>> MAXNAME;
	
    one=new int [MAXNAME];//	Fill in code to allocate the integer variable one here

    two=new int[MAXNAME];//	Fill in code to allocate the integer variable two here

    three=new int [MAXNAME];//	Fill in code to allocate the integer variable three here

    name=new char[MAXNAME];//	Fill in code to allocate the character array pointed to by name
	
    cout << "\nEnter your last name with exactly "<<MAXNAME<<" characters." << endl;
    cout << "If your name has < "<<MAXNAME<<" characters, repeat last letter. " << endl
	 << "Blanks at the end do not count." << endl;

    cout << "\nYour name : ";

    for (pos = 0; pos < MAXNAME; pos++)
       cin>> name[pos];// Fill in code to read a character into the name array
		// WITHOUT USING a bracketed subscript

    cout << "\nHi ";

    for (pos = 0; pos < MAXNAME; pos++)
        cout << name[pos];// Fill in code to a print a character from the name array
	        // WITHOUT USING a bracketed subscript

    cout << endl << "\nEnter three integer numbers separated by blanks" << endl;

    cin>>one[MAXNAME]>>two[MAXNAME]>>three[MAXNAME];// Fill in code to input three numbers and store them in the
    // dynamic variables pointed to by pointers one, two, and three.
    // You are working only with pointer variables

    // echo print
    cout << "\nThe three numbers are " << endl;

    cout<<one[MAXNAME]<<" "<<two[MAXNAME]<<" "<<three[MAXNAME]<<endl; 	// Fill in code to output those numbers

    result = one[MAXNAME]+two[MAXNAME]+three[MAXNAME];	// Fill in code to calculate the sum of the three numbers

    cout << "\nThe sum of the three values is " << result << endl;

    delete [] one;		// Fill in code to deallocate one, two, three and name
	delete [] two;
	delete [] three;
	delete []name;
	one=0;
	two=0;
	three=0;
	name=0;
	
    return 0;
}
