NOTE: windows.h/winbase.h must be #included first
. Как минимум, windows.h содержит в себе это, что по ходу TlHelp32.h используется неоднократно:#define WINAPI
#include <iostream>
#include <fstream>
#include <string>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;
void task3() {
ifstream slovar;
slovar.open("slovar.txt");
ofstream out;
out.open("output.txt");
vector<string> lines;
while (!slovar.eof())
{
string s1;
getline(slovar, s1, '\n');
lines.push_back(s1);
}
sort(begin(lines), end(lines));
set<string> linesSet(begin(lines), end(lines));
for (auto& str : linesSet) {
out << str << endl;
}
slovar.close();
out.close();
}
basds
sdsdsds
sdsdsdssdsds
asdasdsad
basds
basds
sdsdsdssdsds
asdasdsad
basds
sdsdsds
sdsdsdssdsds
g++ myprog.cpp
, если есть заголовочные файлы, то добавите флаг -o. Подробнее обо всем этом здесь. Либо можете установить Visual Studio, изменить там и скомпилировать, вот пошаговая инструкция. #include <iostream>
using namespace std;
int main()
{
int a, b;
int sum;
char i;
cout << "Zaday pervoe chislo\n";
cin >> a;
cout << "Zaday znak\n";
cin >> i;
cout << "Zaday vtoroe chislo\n";
cin >> b;
if (i == '+')
sum = a + b;
if (i == '-')
sum = a - b;
if (i == '*')
sum = a * b;
if (i == '/')
sum = a / b;
cout << "Summa :" << sum << endl;
return 0;
}
void DoubleClick(int x, int y)
{
const double XSCALEFACTOR = 65535 / (GetSystemMetrics(SM_CXSCREEN) - 1);
const double YSCALEFACTOR = 65535 / (GetSystemMetrics(SM_CYSCREEN) - 1);
POINT cursorPos;
GetCursorPos(&cursorPos);
double cx = cursorPos.x * XSCALEFACTOR;
double cy = cursorPos.y * YSCALEFACTOR;
double nx = x * XSCALEFACTOR;
double ny = y * YSCALEFACTOR;
INPUT Input={0};
Input.type = INPUT_MOUSE;
Input.mi.dx = (LONG)nx;
Input.mi.dy = (LONG)ny;
Input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP;
SendInput(1,&Input,sizeof(INPUT));
SendInput(1,&Input,sizeof(INPUT));
Input.mi.dx = (LONG)cx;
Input.mi.dy = (LONG)cy;
Input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
SendInput(1,&Input,sizeof(INPUT));
}
RECT rect;
GetWindowRect(hwnd, &rect);
HWND phwnd = GetForegroundWindow();
SetForegroundWindow(hwnd);
DoubleClick(rect.left + x, rect.top + y);
SetForegroundWindow(phwnd);
#include <iostream>
#include <regex>
#include <string>
using namespace std;
int main() {
const auto input = "Some people, when confronted with a problem, think \"I know, I'll use regular expressions.\""s;
regex rgx("\\W+");
sregex_token_iterator iter(input.begin(),
input.end(),
rgx,
-1);
sregex_token_iterator end;
while (iter != end) {
std::cout << *iter << endl;
++iter;
}
}
void PrintClassName(const ClassName& cl) {
cout << cl.Get() << endl;
}
void PrintClassName(const ClassName& cl) const {
cout << cl.Get() << endl;
}