Технология программирования
C++
Главная »
2018 » Апрель » 3 » Строки Ввод и Вывод
08:56 Строки Ввод и Вывод |
#include <iostream>
using namespace std;
void vvod(char *x);
void vvod2(char *x);
void vivod(char *x);
int main()
{
setlocale(LC_ALL, "Russian");
const int n=80;
char st[n];
vvod(st);
vivod(st);
vvod2(st);
vivod(st);
system("pause");
return 0;
}
void vvod(char *x)
{
gets(x);
}
void vivod(char *x)
{
cout<<x<<endl;
}
void vvod2(char *x)
{
char a;
int i=0;
cin>>a;
while (a!='0')
{
x[i++]=a;
cin>>a;
}
x[i]='\0';
}
|
Просмотров: 246 |
Добавил: denjes
| Рейтинг: 0.0/0 |