#include <iostream>
#include <string>
#include <fstream>
#include <nlohmann/json.hpp>
#include <locale.h>
using namespace std;
int main() {
system("chcp 1251");
cout << "Привет мир!";
nlohmann::json objJson;
fstream fileInput;
fileInput.open("F1.json");
fileInput >> objJson;
cout << objJson << endl;
string nameMatrix;
string nameVector;
int size;
cout << objJson["OneKurs"] << endl;
fileInput.close();
return 0;
}
{
"OneKurs": [
{
"Name": "Алексей",
"Lastname": "Брюханов",
"MiddleName": "Андреевич",
"Gender": "Мужской",
"Subject": {
"Russian": "5",
"Math": "5"
}
},
{
"Name": "Виктор",
"Lastname": "Тарасов",
"MiddleName": "Александрович",
"Gender": "Мужской",
"Subject": {
"Russian": "5",
"Math": "5"
}
},
{
"Name": "Сергей",
"Lastname": "Медведев",
"MiddleName": "Петрович",
"Gender": "Мужской",
"Subject": {
"Russian": "2",
"Math": "4"
}
}
]
}
Сам json сохранен в utf-8