Приложение, которое подсчитывает количество строк в файле. Разработку вести в среде CLR Console Application #include "stdafx.h" #include <stdio.h> //Для printf(), putchar(), getchar() #include <conio.h> //Для _getch() using namespace System; #define eof -1 //Признак конца файла int main() { int c,nl; nl=0; printf("Enter your string and press <Enter> and <Cntl + Z> >\n"); while((c=getchar()) != eof) if (c == '\n') { nl++; } printf("String's number is: %d\n",nl); _getch(); } Код #include "stdafx.h" #include <stdio.h> //Для printf(), putchar(), getchar() #include <conio.h> //Для _getch() using namespace System; #define eof -1 //Признак конца файла int main() { int c,nl; nl=0; printf("Enter your string and press <Enter> and <Cntl + Z> >\n"); while((c=getchar()) != eof) if (c == '\n') { nl++; } printf("String's number is: %d\n",nl); _getch(); }