Advertisement
ZhilinskiyG

Alisa

Apr 10th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include<fstream>
  3. #include<cstring>
  4. using namespace std;
  5. int _tmain(int argc, _TCHAR* argv[])
  6. {
  7.     char str[300];
  8.     ifstream fin("C:\\Users\\Public\\text.txt");
  9.     ofstream fout("C:\\Users\\Public\\index.html");
  10.     while (!fin.eof()){
  11.         fin >> str;
  12.         if (strcmp(str, "Алиса") == 0){
  13.             fout << "<img src='алиса.jpg' width='100px'/>";
  14.         }
  15.         else{
  16.             if (strcmp(str, "Кролик") == 0){
  17.                 fout << "<img src='кролик.jpg' width='100px'/>";
  18.             }
  19.             else{
  20.                 if (strcmp(str, "нора") == 0){
  21.                     fout << "<img src='нора.jpg' width='100px'/>";
  22.                 }
  23.                 else{
  24.                     fout << str << " ";
  25.                 }
  26.             }
  27.         }
  28.     }
  29.     fin.close();
  30.     fout.close();
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement