Created
April 24, 2013 13:47
-
-
Save ahoulgrave/5452240 to your computer and use it in GitHub Desktop.
for y contador de arrobas de una cadena de texto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdlib> | |
#include <iostream> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
char s_Str[150] = "Olmedo, l@a con@cha de @tu madre"; | |
int n_Len = strlen(s_Str); | |
int arrobas = 0; | |
for (int i = 0; i < n_Len; i++) { | |
if (s_Str[i] != '@') { | |
printf("%c\n",s_Str[i]); | |
} else { | |
arrobas++; | |
} | |
} | |
printf("\nArrobas: %d\n\n",arrobas); | |
system("PAUSE"); | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment