-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (29 loc) · 746 Bytes
/
main.cpp
File metadata and controls
32 lines (29 loc) · 746 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
/**
* Created by Zakharov Sergey (aka Zakhse),
* Student of NRU HSE, the Faculty of Computer Science, Software Engineering
* 2k16, November
*/
#include <iostream>
#include <fstream>
#include <locale>
#include <chrono>
#include <bitset>
int main()
{
std::cout << "Enter path to file: ";
std::string path;
std::cin >> path;
std::ifstream file;
file.open(path);
char ch;
long long i = 0;
std::cout << " 1 2 3 4 5 6 7 8 9 10\n";
while (file.get(ch))
{
if (i % 10 == 0)
std::cout << "\n" << i / 10 * 10 << " ";
++i;
std::cout << std::bitset<8>(ch).to_string() << " ";
}
std::cout << "\n";
}