Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <fstream>
- #include <Windows.h>
- #include <string>
- #include <vector>
- #include <iostream>
- #include <Windows.h>
- #include <atlstr.h>
- #include <iostream>
- #include <sstream>
- using namespace std;
- int main(int argc, const char * argv[])
- {
- vector<string> szakirodalom;
- string tmp;
- string currentDate;
- vector<string> v;
- setlocale(LC_ALL, "hun");
- string array[4];
- SYSTEMTIME time;
- GetLocalTime(&time);
- cout << "Részfeladat megnevezése: ";
- getline(cin, array[0]);
- cout << endl;
- cout << "Elvégzett munka rövid leírása: ";
- getline(cin, array[1]);
- cout << endl;
- cout << "Tapasztalatok: ";
- getline(cin, array[2]);
- cout << endl;
- do {
- tmp = "";
- cout << "Felhasznált irodalom: ";
- getline(cin, tmp);
- if (tmp != "")
- {
- szakirodalom.push_back("<a target=\"_blank\" href=\"");
- szakirodalom.push_back(tmp);
- szakirodalom.push_back("\">");
- szakirodalom.push_back(tmp);
- szakirodalom.push_back("</a> ");
- }
- cout << endl;
- } while (tmp!="");
- tmp = "";
- for (int i=0;i<szakirodalom.size();i++)
- {
- tmp += szakirodalom[i];
- }
- array[3] = tmp;
- ifstream file("C:\\Users\\louvre\\Documents\\GitHub\\lorincm.github.io\\munka.html");
- CString cstrMessage;
- cstrMessage.Format("%d-%02d-%02d",
- time.wYear,
- time.wMonth,
- time.wDay
- );
- currentDate = cstrMessage;
- string currentline;
- while (!file.eof())
- {
- getline(file, currentline);
- if (currentline == "<!---->")
- {
- v.push_back("<table> <tr><th>Dátum</th><th>A részfeladat megnevezése</th><th>Elvégzett munka rövid leírása</th><th>Tapasztalatok</th><th>Igénybe vett szakirodalom</th></tr><tr><td>");
- v.push_back(currentDate);
- v.push_back("</td><td>");
- v.push_back(array[0]);
- v.push_back("</td><td>");
- v.push_back(array[1]);
- v.push_back("</td><td>");
- v.push_back(array[2]);
- v.push_back("</td><td> ");
- v.push_back(array[3]);
- v.push_back("</td><td> </table>");
- v.push_back("<!---->");
- }
- else
- {
- v.push_back(currentline);
- }
- }
- file.close();
- ofstream asd("C:\\Users\\louvre\\Documents\\GitHub\\lorincm.github.io\\munka.html");
- asd.clear();
- for (int i=0;i<v.size();i++)
- {
- if (v[i] == "<!---->")
- {
- asd << endl;
- asd << v[i] << endl;
- }
- else
- {
- asd << v[i];
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement