,  ,

- C++

> > >

 
C++ ++ http://www.cyberforum.ru/cpp-beginners/thread895217.html
#include "stdafx.h" #include <iostream> #include <fstream> #include <string> #include <windows.h> using...
C++ : Price C++: Price : ... http://www.cyberforum.ru/cpp-beginners/thread895209.html
'stricmp' undeclared (first use this function) C++
"++ ": // DataSet - store associated data in // an array of objects #include <cstdio> #include <cstdlib> #include <iostream>...
C++
ZNAK, : , ; ; ( ). , ; ...
C++ http://www.cyberforum.ru/cpp-beginners/thread895195.html
. "++" "+", , "- -" "-" . , ...
C++ ( ) , , , . .: ...

Smile11
6 / 6 / 0
: 23.09.2012
: 42
08.06.2013, 20:09
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
#include <iostream>
#include <string>
#include <windows.h>
 
using namespace std;
 
int main (){
string s;    //Ñîçä*ëè îáúåêò êë*ññ* string, ñ ïîìîùüþ êî*ñòðóêòîð* ïî óìîë÷**èþ
int N,i;    
cout<<"Vveditekolichestvoslov v nabore: ";
cin>>N;
_flushall();
string* masslov = new string [N];
for (i=0;i<N;i++){
cout<<"Vvediteslovo #"<<i<<" : ";
getline(cin,masslov[i]);
}
cout<<"Vveditestroku:\n";
getline(cin,s);    //Ñ÷èò*ëè ñòðîêó èç ïîòîê* cin
string razd=" ,.:";
/*Ñîçä*ëè îáúåêò êë*ññ* string, ñ ïîìîùüþ êî*ñòðóêòîð* êîïèðîâ**èÿ äëÿ õð**å*èÿ ãë*ñ*ûõ*/
string s1=s;   /* Ñêîïèðîâ*ëè ñòðîêó s â ñòðîêó s1 ñ ïîìîùüþ ïåðåîïðåäëå**îé îïåð*öèè = */
string word;   // Ñîçä*ëè îáúåêò êë*ññ* string äëÿ õð**å*èÿ âûäåëå**îãî ñëîâ*
char n= s1.find_first_of(razd);
/*Í*øëè ïîçèöèþ ïåðâîãî ð*çäåëèòåëÿ â ñòðîêå s1*/
while (n!=-1){
if (n){
word=s1.substr(0,n);
/*Ñîõð**èëè ïîäñòðîêó äî ð*çäåëèòåëÿ ê*ê î÷åðåä*îé ýëåìå*ò ì*ññèâ* */
for (i=0;i<N;i++)
if (word==masslov[i]){
cout<<word<<endl;
break;
}
}
s1=s1.substr(n+1);
/*Ä*ëåå ð*ññì*òðèâ*åì òîëüêî îñò*âøóþñÿ ÷*ñòü ñòðîêè*/
n=s1.find_first_of(razd);//Í*øëè ïîçèöèþ î÷åðåä*îãî
//ð*çäåëèòåëÿ
}
word=s1; //Îáð*áîòê* ïîñëåä*åãî ñëîâ* â ñòðîêå
for (i=0;i<N;i++)
if (word==masslov[i]){
cout<<word<<endl;
break;
}
system("pause");
return 0;
}
, ...
0
 
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.