Написать программу, которая выводит на экран ваши имя и фамилию 10 раз(C++)

Ответы

Ответ дал: WinSagit
6
#include <iostream>
#include <string>
using namespace std;
int main()
{
string surname="", name="";
cout<<"Input surname\n";
/*вводим с клавиатуры фамилию*/
cin>>surname;
cout<<"Input name\n";
/*вводим с клавиатуры имя*/
cin>>name;
cout<<"\nOutput\n"; 
      for (int i=0; i<10;i++) 
            cout<<surname<<" "<<name<<"\n";
}

ВалєраЛитвак: а без string можно?
WinSagit: можно вместо ( string surname="", name=""; ) написать ( char surname[100],name[100]; ) или же просто
WinSagit: #include <iostream>
using namespace std;
int main()
{
for (int i=0; i<10;i++)
cout<<"Ivanov Ivan\n";
}
Вас заинтересует