Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctype.h>
- #include <conio.h>
- #include <stdio.h>
- #include <Windows.h>
- int main()
- {
- FILE* fin;
- FILE* fout;
- char str[255];
- fopen_s(&fin, "D:\\temp\\lab11i.txt", "rt");
- fopen_s(&fout, "D:\\temp\\lab11o.html", "wt");
- fgets(str, 255, fin);
- fprintf(fout, "<HTML>\n<HEAD>\n<TITLE>%s</TITLE>\n</HEAD>\n<BODY>", &str);
- fprintf(fout, "<H1>%s</H1>", str);
- while (!feof(fin))
- {
- fgets(str, 255, fin);
- int i = 0;
- int asd = 0;
- while (str[i] != 0)
- {
- if (str[i] == 'a' || str[i] == 'A')
- {
- str[i] = '*';
- asd++;
- }
- i++;
- }
- if (asd > 0)
- {
- fprintf(fout, "<i><b>%s</b></i><BR>", str);
- }
- else
- {
- fprintf(fout, "%s<BR>", str);
- }
- str[0] = 0;
- }
- fclose(fout);
- fclose(fin);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement