Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- #define MAX 80
- void wtf() {
- FILE *f = fopen("text.txt", "w");
- char c;
- while((c = getchar()) != EOF) {
- fputc(c, f);
- }
- fclose(f);
- }
- char Samoglaska(char c)
- {
- toupper(c); //site golemi da gi naprai
- if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u') {
- return 1;
- }
- }
- int main() {
- wtf();
- FILE* f=fopen("text.txt", "r");
- if(f==NULL) {
- return 0;
- }
- char red[MAX],posledovatelni[MAX];
- int i,n,reden,max=0,brojac=0, maxRed=0;
- while(fgets(red,MAX,f)!=NULL)
- {
- n=strlen(red);
- for(i=0;i<n;i++)
- {
- if(!Samoglaska(red[i]) && !isspace(red[i])
- {
- brojac++;
- }
- else if(Samoglaska(red[i])
- {
- if(brojac>=max)
- {
- max=brojac;
- brojac=0;
- }
- }
- }
- if(max>maxRed)
- {
- maxRed=max;
- for(i=0;i<80;i++)
- {
- posledovatelni[i]=red[i];
- }
- }
- printf("%d\n",maxRed);
- printf("%s",posledovatelni);
- fclose(f);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement