#include <iostream>
#include <fstream>
#include <string>
using std::cin;
using std::string;
int main(){
setlocale(LC_ALL,"Russian");
string str;
while(cin >> str)//While Ctrl-Z (Ctrl-D *nix)
{
std::ofstream exp("text.txt");
exp << str << std::endl;
}
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
for (i=0;i<3;i++)
{
char str[10]="";
printf("first print %s\n",str);
scanf("%s",str);
printf("second print %s\n",str);
}
return 0;
}