If it weren't for the specification "show array manipulation", you could just use std::list (or vector) with a search algorithm. Unfortunately, you can't. But I'm bored so I'll write this anyway:
Code:
#include <cstdlib>
#include <iostream>
#include <list>
#include <algorithm>
int get_num(); //returns number
bool print_num(int num,std::list<int> & nums); //true if it prints
int main(/*stuff*/)
{
std::list<int> nums;
int num_of_num;
std::cout << "How many will you be giving me?" << std::endl;
std::cin >> num_of_num;
int num;
for(int c = 0; c < num_of_nums; c++)
{
num = get_num(); //won't return until valid number is entered
if( print_num(num,nums) ) nums.push_back(num);
//if the number prints, then it is new, so add it to the list
}
std::system("PAUSE");
return EXIT_SUCCESS;
}
int get_num()
{
int num;
do {
std::cin >> num;
}while(num < 1 || num > 100);
return num;
}
bool print_num(int num,std::list<int> & nums)
{
if(std::binary_search(nums.begin(), nums.end(), num)) return false;
else std::cout << '\t' << num << std::endl;
return true;
}