неужели результат
Этот коммит содержится в:
3
lab1.cbp
3
lab1.cbp
@@ -31,9 +31,12 @@
|
|||||||
<Compiler>
|
<Compiler>
|
||||||
<Add option="-Wall" />
|
<Add option="-Wall" />
|
||||||
<Add option="-fexceptions" />
|
<Add option="-fexceptions" />
|
||||||
|
<Add directory="C:/Users/temka/OneDrive/Desktop/лаба 1/lab1/curl/include" />
|
||||||
</Compiler>
|
</Compiler>
|
||||||
<Linker>
|
<Linker>
|
||||||
<Add option="-static-libstdc++" />
|
<Add option="-static-libstdc++" />
|
||||||
|
<Add library="libcurl.dll.a" />
|
||||||
|
<Add directory="C:/Users/temka/OneDrive/Desktop/лаба 1/lab1/curl/lib" />
|
||||||
</Linker>
|
</Linker>
|
||||||
<Unit filename="histogram.cpp" />
|
<Unit filename="histogram.cpp" />
|
||||||
<Unit filename="histogram.h">
|
<Unit filename="histogram.h">
|
||||||
|
|||||||
10
main.cpp
10
main.cpp
@@ -4,14 +4,12 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
size_t write_data(void* ptr, size_t size, size_t nmemb, std::stringstream* stream) {
|
size_t write_data(void* ptr, size_t size, size_t nmemb, std::stringstream* stream) {
|
||||||
size_t data_size = size * nmemb;
|
size_t data_size = size * nmemb;
|
||||||
stream->write(static_cast<const char*>(ptr), data_size);
|
stream->write(static_cast<const char*>(ptr), data_size);
|
||||||
return data_size;
|
return data_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Input download(const std::string& url) {
|
Input download(const std::string& url) {
|
||||||
std::stringstream buffer;
|
std::stringstream buffer;
|
||||||
|
|
||||||
@@ -40,11 +38,9 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
Input input;
|
Input input;
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
std::cout << "Êîëè÷åñòâî àðãóìåíòîâ: " << argc << std::endl;
|
input = download(argv[1]);
|
||||||
for (int i = 0; i < argc; ++i) {
|
} else {
|
||||||
std::cout << "argv[" << i << "] = " << argv[i] << std::endl;
|
input = input_data(std::cin, true);
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto bins = make_histogram(input.numbers, input.bin_count);
|
auto bins = make_histogram(input.numbers, input.bin_count);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user