#include <fstream>
#include <string>
#include <iostream>
int main()
{
std::ifstream file("Read.txt");
std::string str;
// это id первого символа второго столбца, если считать столбец с нумерацией первым,
// его надо будет подсчитать для каждой строки.
int startOffset = 6;
while (std::getline(file, str))
{
std::cout << "2: " << str.substr(startOffset + 11 * 0, 10);
std::cout << " 3: " << str.substr(startOffset + 11 * 1, 10);
std::cout << " 10: " << str.substr(startOffset + 11 * 8, 10);
std::cout << std::endl;
}
}
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
std::string to_string(std::vector<char> data)
{
std::stringstream ss;
for(size_t i = 0; i < data.size(); ++i)
{
if(i != 0)
{
ss << data[i];
}
}
return ss.str();
}
int main()
{
std::vector<char> str;
char c;
std::cout << "Enter text: ";
while(std::cin.get(c) && c != '\n')
{
str.push_back(c);
}
std::string result = to_string(str);
std::cout << result;
}
#include <Windows.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float x;
HDC hDC = GetDC( GetConsoleWindow( ) );
HPEN Pen = CreatePen( PS_SOLID, 2, RGB(255, 255, 255));
SelectObject( hDC, Pen );
MoveToEx( hDC, 0, 85, NULL );
LineTo( hDC, 200, 85 );
MoveToEx( hDC, 100, 0, NULL );
LineTo( hDC, 100, 170 );
for ( x = -8.0f; x <= 8.0f; x += 0.01f ) // O(100,85) - center
{
MoveToEx( hDC, 10*x+100, -10*sin(x)+85, NULL );//10 - scale
LineTo( hDC, 10*x+100, -10*sin(x)+85 );
}
system("pause");
}