MIPI_BaseC_WebinarFRTK/09_Lecture09/01_getchar_p8.c

15 lines
281 B
C
Raw Normal View History

2024-11-13 09:22:28 +03:00
#include <stdio.h>
int main(int argc, char **argv)
{
char s[100], c;
int i=0;
while( (c=getchar())!='\n' )
s[i++]=c;
s[i]='\0';
i=0;
while( s[i] ) // s[i] != 0
putchar(s[i++]);
printf("\n%s\n",s); // напечатать строку
}