Answer the question
In order to leave comments, you need to log in
How does the program receive input?
/* Напишите программу печати всех вводимых строк, содержащих более 80 символов. */
#include <stdio.h>
int MAXLINE = 1000;
int getlinel(char line[], int MAXLINE);
int main()
{
int len, min = 10;
char line[MAXLINE];
while ((len = getlinel(line, MAXLINE)) > 0)
if (len > 80){
printf("%s\n", line);
}
return 0;
}
int getlinel(char s[], int lim)
{
int c, i;
for (i = 0; i < lim-1 && (c = getchar()) != EOF && c != '\n'; ++i)
s[i] = c;
if (c == '\n') {
s[i] = c;
++i;
}
s[i] = '\0';
return i;
}
Answer the question
In order to leave comments, you need to log in
There is no putchar() or scanf() or the like here.
c = getchar()
.WHERE does the program get input from?
for (i = 0; i < lim-1 && (c = getchar()) != EOF && c != '\n'; ++i)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question