[ create a new paste ] login | about

Link: http://codepad.org/2kPNHXnX    [ raw code | output | fork ]

C++, pasted on Apr 9:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <locale.h>
#include <string.h>
#include <wchar.h>

int main(int argc, char* argv[])
{
	setlocale(LC_ALL,"Russian");

	static wchar_t str[256] = L"Цыганова\0";

	int count = 0;
	wchar_t wpchars[] = L"ауоыиэяюёе";
	for (int index = 0; str[index] != '\0'; index++)
		if (wcschr(wpchars, str[index])) count++;

	wprintf(L"string = %s\nvowels count = %d\n",str,count);

	return 0;
}


Output:
1
2
string = &
vowels count = 4


Create a new paste based on this one


Comments: