Ok I need to make a 3 part program thats made with c++. The first part is to write 10 number, and then program ask to ether repeat the number or to reapeat them reverse. Second part I need to make a program that ask for a word and later ask for a letter. Then the program will say that he found the letter to then ask if to tell you the first one or the last one. After you tell him what you want he will tell you the location where he found it. Last part is that he will ask for you to write a word or sentece to later ask you a word to then tell you all the locations that word appears. I starded something but I stupid brain won't work so yeah heres what I started:
#include <iostream>
#include <string>
using namespace std;
string ST1;
int I = 0, Idos, Ans;
int N[11];
int main()
{
cout << "Escribe 10 numeros" << endl ;
for (int I = 1; I <= 10; I++)
{
cout << I << ")"; cin >> N[I]; cout << "\n";
}
cout << "1)Repetirlos en orden O 2) Repetirlos alreves:";
cin >> Ans;
cout << endl;
if (Ans == 1)
{
for (int I = 1; I <= 10;I++ )
{
cout << I << ")" << N[I] << "\n" << endl;
}
}
if (Ans == 2)
{
for (int I = 10; I >= 0; I--)
{
cout << I << ")" << N[I] << "\n" << endl;
}
}
system("pause");
}