Skip to content

Instantly share code, notes, and snippets.

@dertst
Created November 23, 2018 06:43
Show Gist options
  • Save dertst/b3eda704e4e38337ffab24f5b8b0a3ff to your computer and use it in GitHub Desktop.
Save dertst/b3eda704e4e38337ffab24f5b8b0a3ff to your computer and use it in GitHub Desktop.
[Пересланное сообщение]
Марк Захар, 20 ноября в 12:29
#include "stdafx.h"
#include <cstdio>
#include <conio.h>
int main()
{
FILE *f;
char s[255];
fopen_s(&f,"C:\\Users\\user\\Desktop\\IVT11\\temp\\input.txt","rt");
fgets (s, 255, f);
fopen_s(&f, "C:\\Users\\user\\Desktop\\IVT11\\temp\\output.html","wt");
fprintf(f,"<HTML>\n");
fprintf(f,"<HEAD>\n");
fprintf(f,"<TITLE>ЗАДАНИЕ-А</TITLE>\n");
fprintf(f,"</HEAD>\n");
fprintf(f,"<BODY>\n");
fprintf(f,"<H1>");
fputs (s, f);
fprintf(f,"</H1>\n");
int flag;
int i=0;
while( s[i]!=0)
{
if (s[i]='a')
{
flag=1;
break;
}
i++;
}
if (flag)
{
fprintf(f,"<b>,<i>");
fputs (s, f) ;
fprintf(f,"</b>,</i>\n");
}
else
{
fputs (s, f) ;
}
fprintf(f,"</BODY>\n");
fprintf(f,"</HTML>\n");
fclose(f);
fclose(f);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment