-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathChatTranscript.cpp
More file actions
60 lines (43 loc) · 979 Bytes
/
ChatTranscript.cpp
File metadata and controls
60 lines (43 loc) · 979 Bytes
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
51
52
53
54
55
56
57
58
59
60
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
class ChatTranscript {
public:
int howMany(vector <string> transcript, string name)
{
int i, j;
int counter = 0;
string::iterator it;
for (i=0; i<transcript.size(); i++)
{
int flg = 0;
it = find(transcript[i].begin(), transcript[i].end(), ':');
if (transcript[i].begin() + name.size() != it)
continue;
for (j=0; j<name.size(); j++)
if (transcript[i][j] != name[j])
{
flg = 1;
break;
}
if (flg == 0)
counter++;
}
return counter;
}
};
// Powered by FileEdit
// Powered by TZTester 1.01 [25-Feb-2003]
// Powered by CodeProcessor
// Powered by FileEdit
// Powered by TZTester 1.01 [25-Feb-2003]
// Powered by CodeProcessor
// Powered by FileEdit
// Powered by TZTester 1.01 [25-Feb-2003]
// Powered by CodeProcessor