Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #define KONEC ".,:;?!\n\t"
- #define N 1024
- int Isupper(char *s)
- {
- int i,count=0;
- for(i = 0 ; s[i] != '\0';i++)
- if(isupper(s[i]))
- count++;
- return count;
- }
- int Isdigit(char *s)
- {
- int i,count=0;
- for(i = 0 ; s[i] != '\0';i++)
- if(isdigit(s[i]))
- count++;
- return count;
- }
- int Isalpha(char *s)
- {
- int i,count=0;
- for(i = 0 ; s[i] != '\0';i++)
- if(isalpha(s[i]))
- count++;
- return count;
- }
- void Del(char *s)
- {
- int i,j;
- char buf;
- for( i = 0 ; s[i] !='\0'; i++)
- if(s[i]=='A' || s[i]=='E' || s[i]=='I' || s[i]=='O' || s[i]=='U')
- {
- for(j=i;s[j+1] != '\0';j++)
- {
- buf=s[j];
- s[j]=s[j+1];
- s[j+1]=buf;
- }
- s[j]='\0';
- }
- puts(s);
- }
- int main()
- {
- char s[N];
- char *word,*buf="\0";
- int i,j,flag[256]={0},k=0,max,end;
- fgets(s,N,stdin);
- for(i = 0; KONEC[i]; i++)
- flag[KONEC[i]]=1;
- for( i = 0 ; s[i] && flag[s[i]]; i++)
- ;
- while(s[i])
- {
- word = &s[i]; //s + i;
- while( s[i] && !flag[s[i]])
- i++;
- j = i;
- while( s[i] && flag[s[i]])
- i++;
- s[j] = '\0';
- end=strlen(word); //razmer stroki do \0
- if(Isdigit(word)==end) // Slovo iz cifr
- {
- printf("\nSlovo TOKO IZ CIFR\n");
- puts(word);
- }
- if(Isalpha(word)==end) //slovo iz bukv
- {
- printf("\nSLovo TOKO IZ BUKV\n");
- puts(word);
- }
- if(Isupper(word)==end) // esli vse bukvi v stroke BIG
- if(end>strlen(buf))
- {
- max=end;
- buf=word;
- }
- }
- printf("\nMax Stroka=\n");
- puts(buf);
- printf("\nvizov DEL\n");
- Del(buf);
- printf("\nOTVET\n");
- puts(buf);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment