Skip to content

Instantly share code, notes, and snippets.

@harconst
Created May 31, 2018 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harconst/6bcb849d68e6348aa4a8854c861ae5fa to your computer and use it in GitHub Desktop.
Save harconst/6bcb849d68e6348aa4a8854c861ae5fa to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int main()
{
char frash[60];
int i, mikos, plithos;
printf("Dwse th frash sou\n");
fgets(frash, 60, stdin);
printf("Pliktrologises: %s\n", frash);
mikos = strlen(frash);
for (i=0; i<mikos;i++) {
if (frash[i] == 82) {
plithos++;
frash[i] = frash[i] + 32;
}
}
printf("o xaraktiras R vrethike %d fores\n", plithos);
if (plithos % 2 == 0) {
printf("O arithmos forwn pou brika to R einai pollaplasio toy 2\n");
}
if (plithos == 0) {
printf("O xaraktiras R de brethike\n");
}
printf("To mhnuma me mikra r anti kefalaia R: %s\n", frash);
system("PAUSE");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment