Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Лабораторная работа №11
- *Группа: 80-103б
- *Игнатьев Максим
- *Вариант №22
- */
- #include <stdio.h>
- #include <ctype.h>
- using namespace std;
- int main(){
- int length = 0, number = 0;
- char ch;
- printf("Insert text: \n");
- while(ch != EOF){
- ch = getchar();
- if (isalpha(ch)) {length += 1; continue;}
- if (isspace(ch) || ch == ',') {
- if (length >= 3) number += 1;
- length = 0;
- }
- if (ch == '\n') {
- printf("%d\n", number);
- number = 0;
- printf("Insert text: \n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement