-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
40 lines (39 loc) · 947 Bytes
/
main.cpp
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
#include <iostream>
#include "Text_Preprocessor.h"
using namespace std;
int main() {
//main class
char array_text[1000];
cin >> array_text;
Text_Preprocessor san(array_text);
san.preprocess_text();
int index = san.search_word("a");
if(index == -1){
cout << "Word not found!";
}
else{
cout << index << endl;
}
ifstream file;
file.open("C:/Users/aaruz/CLionProjects/ass7/Task2.txt");
ofstream outfile1 ("Thread_1.txt");
ofstream outfile2 ("Thread_2.txt");
double *array1 = new double[1002];
double ave = 0;
for(int i = 0; i < 100; ++i){
file >> array1[i];
ave += array1[i];
}
ave /= 100;
for(int i = 0; i < 100; ++i){
if(array1[i] - ave > 0){
outfile1 << array1[i] << endl;
}
else{
outfile2 << array1[i] << endl;
}
}
outfile1.close();
outfile2.close();
return 0;
}