Difference between revisions of "Solução: Problema da competição alien (Tito Filho)"
From AdonaiMedrado.Pro.Br
(New page: <code lang="c"> #include <stdio.h> #include <string.h> int main (void) { char frase[250]; int i,N,x,soma; scanf("%d",&N); if (N>=1 && N<=10) { scanf("%s", frase); ...) |
(No difference)
|
Revision as of 16:24, 3 April 2009
#include <stdio.h> #include <string.h> int main (void) { char frase[250]; int i,N,x,soma; scanf("%d",&N); if (N>=1 && N<=10) { scanf("%s", frase); i=0; soma=0; while (frase[i]!='\0') { x=0; while(frase[i]>='a' && frase[i]<='z') { x++; i++; } i++; if (x==N) ++soma; } printf("%d",soma); } }