Assuming this code:
#include <iostream>
using namespace std;
int letters_counted_in_text( std::string const&text ) {
int count = 0;
string abc = "abcdefghijklmnñopqrstuvwxyzáéíóúABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚ";
for( unsigned i=0; i<text.length(); ++i )
for( unsigned j=0; j<abc.length(); ++j )
if( text.at( i )==abc.at( j ) )
{
count++;
j=abc.length();
}
return count;
}
int main() {
// your code goes here
string test = "Hola, cómo estás";
cout << letters_counted_in_text(test);
return 0;
}
why it has different behavior in codechef
:
OutPut:
13
But in ideone
is:
OutPut:
15
in cpp.sh
OutPut: is 15
To what can this behavior be? I'm sorry for my bad english I hope you can understand what I say?