Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- void wtf() {
- FILE *f = fopen("text.txt", "w");
- char c;
- while((c = getchar()) != EOF) {
- fputc(c, f);
- }
- fclose(f);
- }
- int soglaska(char c)
- {
- c=tolower(c);
- return !(c=='a' || c=='e' || c=='i' || c=='o' || c=='u');
- }
- int main() {
- wtf();
- // vashiot kod ovde
- FILE *vlez=fopen("text.txt","r");
- char a[100][80];
- int i=0, j=0, max_red=0, broj_momentalen=0, broj_max=0;
- while(fgets(a[j], 80, vlez) != NULL)
- {
- for(i=0, broj_momentalen=0; i<strlen(a[j]); i++)
- {
- if(isalpha(a[j][i]))
- {
- if(soglaska(a[j][i]))
- {
- broj_momentalen++;
- }
- else
- {
- if(broj_max<broj_momentalen)
- {
- broj_max=broj_momentalen;
- broj_momentalen=0;
- max_red=j;
- }
- else
- {
- broj_momentalen=0;
- }
- }
- }
- }
- broj_momentalen=0;
- j++;
- }
- printf("%d\n%s",broj_max,a[max_red]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement