@Mиxaил
534 / 439 / 37
Регистрация: 10.12.2009
Сообщений: 1,857
|
05.10.2011, 00:43
|
|
Можно так:
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
| #include <iostream>
#include <string>
const int N = 10;
bool DoubleDealingFellow ( const std::string word )
{
bool Checker = true;
int i = 0;
while ( ( i < word.length() / 2 ) && ( Checker ) )
{
Checker = ( word [ i ] == word [ word.length() - i - 1 ] );
i++;
}
return Checker;
}
int main ()
{
std::string *ArrayWords = new std::string [ N ];
// Ввод масива слов
unsigned int count = 0;
for ( int index = 0; index < N; index++ )
if ( !DoubleDealingFellow ( ArrayWords [ index ] ) )
count++;
std::cout << "Count: " << count << std::endl;
delete []ArrayWords;
std::cin.get();
return 0;
} |
|
0
|