,   CyberForum.ru

- C++


C++ http://www.cyberforum.ru/cpp-beginners/thread634715.html
! - . 0. , , . ? : . : ...
C++ HDC 1) HDC ? , WM_CREATE : hdc = BeginPaint(hWnd, &ps); hdc = GetDC(hWnd); WM_CREATE - hdc . . ? hWnd ? 2) - ? : int abc = 10, x; string b =... http://www.cyberforum.ru/cpp-beginners/thread634697.html
C++
;b x:3-0,2x^2+0,3x-1,2=0; c . 1. . 2. ε = 0,001 3. ζ ...
C++
, " ". . . . . : : 1) ; 2) , ; 3)...
C++ , http://www.cyberforum.ru/cpp-beginners/thread634674.html
: , . , , , . ,, !
C++ ++ . ++ . " C++ 21 " Borland Visual Studio . Hello world Visual Studio 2010. - ...

-==-
FAQ
08.08.2012, 15:29    

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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <string>
#include <sstream>
#include <iostream>
using namespace std;
 
//Ôó*êöèÿ âåð*¸ò ÈÑÒÈÍÓ åñëè â
//ñëîâå word ãë*ñ*ûõ áîëüøå ÷åì ñîãë*ñ*ûõ
bool isVowelsMore(string word);
 
int main()
{
    string word;//áóäåò ñîäåð*æòü ñëîâî èç òåêñò*
    string text;//áóäåò ñîäåð*æòü ââîäèìûé òåêñò
    cout<<"Enter text : ";
    //getline(cin,text);//Ð*ñêîìå*òèðîâ*òü äëÿ ðó÷*îãî ââîä*
    
    //2 ñòðîêè *èæå èçúÿòü åñëè õîòèì ââîäèòü ðóê*ìè
    text = "this is the teeeest ooof program";
    cout<<text<<endl;
    stringstream ss(text);//È*èöè*ëèçèðóåì ñòðîêîâûé ïîòîê
    //èç *åãî ìîæ*î áóäåò ÷åðï*òü ñëîâ* ê*ê èç ifstream
    text = "";//Î÷èù*åì ñòðîêó ñ òåêñòîì
    while(ss>>word)
    {
        //ò.å. äåë*åì òåêñò òîëüêî èç ñëîâ
        //â êîòîðûõ ñîãë*ñ*ûõ áîëüøå ÷åì ãë*ñ*ûõ
        if(!isVowelsMore(word))
            text += word + " ";
    }
    //Ñ*îâ* ïå÷*ò*åì òåêñò *î óæå áåç ñëîâ ñ ïðåîáë*ä**èåì ãë*ñ*ûõ
    cout<<text<<endl;
    return 0;
}
 
bool isVowelsMore(string word)
{
    int nVowels = 0;//Áóäåò ñîäåðæ*òü ÷èñëî ãë*ñ*ûõ â ñëîâå word
    string vowels = "aouyei";
    for(int i = 0; i < word.length(); i++)
    {
        //Óñëîâèå ò*êîå - åñëè word[i] â *èæ*åì ðåãèñòðå
        //(Ò.å. åñëè áûëî Î òî ïîñëå tolower ñò**åò î)
        //ñîäåðæèòñÿ â ñòðîêå âñåõ ãë*ñ*ûõ ë*òè*èöû
        if(vowels.find(tolower(word[i]),0) != string::npos)
            nVowels = nVowels + 1;
    }
    //Âîçâð*ù*åì ðåçóëüò*ò ëîãè÷åñêîãî ñð*â*å*èÿ
    //äëè**_ñëîâ* - ÷èëî_ãë*ñ*ûõ == ÷èñëî_ñîãë*ñ*ûõ < ÷èëî_ãë*ñ*ûõ)
    return (word.length() - nVowels < nVowels);
}
http://liveworkspace.org/code/335f2d...25e092c4a35ebd
    
 
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
@Mail.ru