/ Graveyard /

记录详情

Wrong Answer


  
# 状态 耗时 内存占用
#1 Wrong Answer 3ms 372.0 KiB
#2 Wrong Answer 3ms 256.0 KiB
#3 Wrong Answer 3ms 352.0 KiB
#4 Wrong Answer 3ms 368.0 KiB

代码

//1099HTML
#include <iostream>
#include <stdio.h>
#include <string>
#define FILE_DEBUG

#ifdef FILE_DEBUG
#include <fstream>
#endif

using namespace std;
int main(int argc, char *argv[])
{
#ifdef FILE_DEBUG
	ifstream fin;
	fin.open("input.txt");
	cin.rdbuf(fin.rdbuf()); // assign file's streambuf to cin
#ifdef _C_LAN_
	freopen("input.txt", "r", stdin);
#endif
#endif
#ifdef FILE_DEBUG
	ofstream fout;
	fout.open("output.txt");
	cout.rdbuf(fout.rdbuf()); // assign file's streambuf to cout
#ifdef _C_LAN_
	freopen("output.txt", "w", stdout);
#endif
#endif

    int count = 0;
    string str_in;
    while (cin >> str_in)
    {
          if (str_in == "<br>")
          {
             cout << endl;
             count = 0;
          }
          else if (str_in == "<hr>")
          {
              if (count > 0)
              {
                 cout << endl;
              }
              for (int i = 0; i < 80; i ++)
              {
                  cout << '-';
              }
              cout << endl;
              count = 0;
          }
          else
          {
              if (count + str_in.size() + 1 <= 80)
              {
                  if (count > 0)
                  {
                     cout << " ";
                     count ++;
                  }
                 cout << str_in;
                 count += str_in.size();
              }
              else
              {
                  cout << endl << str_in;
                  count = str_in.size();
              }
          }
          //cout << "(end is_nl: " << is_nl << ")";
    }
    cout << endl;
    return 0;
}

信息

递交者
类型
递交
题目
HTML Translation HTML语言解析
语言
C++
递交时间
2017-07-09 15:57:13
评测时间
2017-07-10 08:24:15
评测机
分数
0
总耗时
12ms
峰值内存
372.0 KiB