Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- int a_erwtima(char str[])
- {
- int i, sinolo;
- sinolo=1;
- for(i=1; i<=100; i++)
- {
- if(str[i]==' ')
- {
- sinolo=sinolo+1;
- }
- }
- printf("oi lexeis einai %d\n", sinolo);
- return 0;
- }
- int b_erwthma(char str[])
- {
- int T[26];
- int i, sum, j, max;
- char z, lmax;
- char K[26];
- for(i=1; i<=26; i++)
- {
- T[i]=0;
- }
- i=1;
- for(z='a'; z<='z'; z++)
- {
- K[i]=z;
- i=i+1;
- }
- sum=0;
- for(i=1; i<=26; i++)
- {
- for(j=1; j<=100; j++)
- {
- if(str[j]==K[i])
- {
- sum=sum+1;
- }
- }
- T[i]=sum;
- printf("%d",sum);
- sum=0;
- }
- max=T[1];
- lmax=K[1];
- for(i=2; i<=26; i++)
- {
- if(T[i]>max)
- {
- max=T[i];
- lmax=K[i];
- }
- }
- printf("o xaraktiras me tin megaliteri sixnotita einai o %c\n", lmax);
- return 0;
- }
- int c_erwthma(int end)
- {
- printf("termatismos? 1. NAI 2. OXI\n");
- scanf("%d", &end);
- return end;
- }
- int main ()
- {
- char str[100];
- int epilogi, end;
- do
- {
- printf("dwse mia simbolosira\n");
- gets(str);
- a_erwtima(str);
- b_erwthma(str);
- c_erwthma(end);
- }while(end == 2);
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement