#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char temp;
FILE *fp;
if((fp=fopen("stwt.txt","w"))==NULL)
{
printf("cannot open file.");
exit(1);
}
while(1)
{
scanf("%c",&temp);
if(temp == '0')
break;
fwrite(&temp,sizeof(char),1,fp);
}
fclose(fp);
return 0;
}