以前的用过的标签

(作业 不用详细看)

<p>这是一个段落1</p>

<p align="right">这是一个段落2</p>

<p align="center">这是一个段落3</p>

<h1>h1标题1</h1>

<h2>h2标题2</h2>

<h3>h3标题3</h3>

<h4>h4标题4</h4>

<h5>h5标题5</h5>

<h6>h6标题6</h6>

<b>定义粗体文本</b>

<i> 定义斜体文本 </i>

<del>定义删除文本</del>

<sup>定义上标字</sup>

<sub>定义下标字</sub>

<a href=#> 这是一个链接 </a>

<img src="tp.jpg" width="100" height="" alt="替代文字" usemap="map名称"/>

<map name="map名称">

<area shape="rect" coords="0,0,30,30" href="#" />

</map>

<audio src="xxx.mp3" controls></audio>

<video src=xxx.mp4controls></video>

<br>

> < "   ® © &

<ul>

<li>li1</li>

<li>li2</li>

<li>li3</li>

</ul>

<ol>

<li>li4</li>

<li>li5</li>

<li>li6</li>

</ol>

<dl>

<dt>dl</dt>

<dd>定义列表</dd>

<dt>dd</dt>

<dd>定义表格的一个项</dd>

<dd>定义列表用来组织术语和它们的定义</dd>

</dl>

<!-- form是个包含表单元素的区域 用于向服务器传输数据 -->

<form action="#" method="post" enctype="multipart/form-data">

<input type="text" name="username" value="" />

<input type="password"name="passwd"/>

<input type="radio"name="sex"value="1"checked="checked" />

<input type="radio"name="sex"value="0"/>

<input type="checkbox"name="love"value="music" checked="checked"/> 听音乐

<input type="checkbox"name="love" value="movie"/> 看电影

<input type="checkbox"name="love" value="game"/> 玩游戏

<input type="button" name="btn" value="确定"/>

<input type="submit" name="comit" value="提交"/>

<input type="reset" name="reset" value="重写"/>

<input type="image"name="img_btn" src="tp2.jpg"/>

<input type="hidden" name="uid" value="10"/>

<input type="file" name="photo"/>

<input type="color" name="color"/>

<input type="date" name="date"/>

<input type="datetime-local" name="datetime-local"/>

<input type="month" name="month"/>

<input type="week" name="week">

<textarea name="content" rows="5" cols="50"> </textarea>

<select name="city">

<optgroup label="请选择"></option>

<option value="bj">佛山</option>

<option value="gz">广州</option>

</select>

</form>

<iframe src="http://baidu.com" width="300" height="300">

转载于:https://www.cnblogs.com/zhiwudenengliang/p/5738450.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个基于easyx库的c++情绪日记代码。代码中使用了一个vector来保存历史记录,每次保存时将情绪、文本、日期等信息打包成一个结构体存入vector中,点击历史记录按钮时按照日期逆序输出。 ```cpp #include <iostream> #include <graphics.h> #include <conio.h> #include <ctime> #include <vector> #include <string> using namespace std; // 情绪枚举 enum Mood { HAPPY, ANGRY, SAD, JOYFUL }; // 历史记录结构体 struct Record { Mood mood; // 情绪 string text; // 文本 time_t time; // 时间 char date[20]; // 日期字符串 }; // 窗口大小 const int WIDTH = 600, HEIGHT = 400; // 文本框位置和大小 const int TEXTBOX_X = 30, TEXTBOX_Y = 50, TEXTBOX_WIDTH = 540, TEXTBOX_HEIGHT = 200; // 标签位置和大小 const int LABEL_X = 30, LABEL_Y = 270, LABEL_WIDTH = 120, LABEL_HEIGHT = 30; const int LABEL_MARGIN = 20; // 标签之间的间隔 // 按钮位置和大小 const int SAVE_BUTTON_X = 30, SAVE_BUTTON_Y = 320, SAVE_BUTTON_WIDTH = 80, SAVE_BUTTON_HEIGHT = 30; const int HISTORY_BUTTON_X = 130, HISTORY_BUTTON_Y = 320, HISTORY_BUTTON_WIDTH = 80, HISTORY_BUTTON_HEIGHT = 30; // 鼠标点击区域 struct ClickArea { int x, y, width, height; }; // 标签的鼠标点击区域 vector<ClickArea> labelClickAreas; // 按钮的鼠标点击区域 ClickArea saveClickArea, historyClickArea; // 历史记录 vector<Record> history; // 获取当前时间的字符串表示 char* getCurrentDate() { time_t now = time(nullptr); strftime(static_cast<char*>(malloc(20)), 20, "%Y-%m-%d %H:%M:%S", localtime(&now)); } // 绘制文本框 void drawTextBox() { setfillcolor(WHITE); setlinecolor(BLACK); roundrect(TEXTBOX_X, TEXTBOX_Y, TEXTBOX_X + TEXTBOX_WIDTH, TEXTBOX_Y + TEXTBOX_HEIGHT, 10, 10); } // 绘制标签 void drawLabels() { settextcolor(BLACK); setbkmode(TRANSPARENT); settextstyle(20, 0, _T("微软雅黑")); const char* labels[] = { "喜", "怒", "哀", "乐" }; const COLORREF colors[] = { RGB(255, 192, 203), RGB(255, 0, 0), RGB(192, 192, 192), RGB(255, 255, 0) }; for (int i = 0; i < 4; i++) { setfillcolor(colors[i]); setlinecolor(BLACK); roundrect(LABEL_X + i * (LABEL_WIDTH + LABEL_MARGIN), LABEL_Y, LABEL_X + i * (LABEL_WIDTH + LABEL_MARGIN) + LABEL_WIDTH, LABEL_Y + LABEL_HEIGHT, 10, 10); ClickArea ca = { LABEL_X + i * (LABEL_WIDTH + LABEL_MARGIN), LABEL_Y, LABEL_WIDTH, LABEL_HEIGHT }; labelClickAreas.push_back(ca); outtextxy(LABEL_X + i * (LABEL_WIDTH + LABEL_MARGIN) + 30, LABEL_Y + 5, labels[i]); } } // 绘制按钮 void drawButtons() { settextcolor(BLACK); setbkmode(TRANSPARENT); settextstyle(20, 0, _T("微软雅黑")); setfillcolor(RGB(135, 206, 250)); setlinecolor(BLACK); roundrect(SAVE_BUTTON_X, SAVE_BUTTON_Y, SAVE_BUTTON_X + SAVE_BUTTON_WIDTH, SAVE_BUTTON_Y + SAVE_BUTTON_HEIGHT, 10, 10); saveClickArea = { SAVE_BUTTON_X, SAVE_BUTTON_Y, SAVE_BUTTON_WIDTH, SAVE_BUTTON_HEIGHT }; outtextxy(SAVE_BUTTON_X + 20, SAVE_BUTTON_Y + 5, _T("保存")); setfillcolor(RGB(135, 206, 250)); setlinecolor(BLACK); roundrect(HISTORY_BUTTON_X, HISTORY_BUTTON_Y, HISTORY_BUTTON_X + HISTORY_BUTTON_WIDTH, HISTORY_BUTTON_Y + HISTORY_BUTTON_HEIGHT, 10, 10); historyClickArea = { HISTORY_BUTTON_X, HISTORY_BUTTON_Y, HISTORY_BUTTON_WIDTH, HISTORY_BUTTON_HEIGHT }; outtextxy(HISTORY_BUTTON_X + 10, HISTORY_BUTTON_Y + 5, _T("历史记录")); } // 绘制历史记录 void drawHistory() { settextcolor(BLACK); setbkmode(TRANSPARENT); settextstyle(16, 0, _T("微软雅黑")); int y = 50; for (auto it = history.rbegin(); it != history.rend(); it++) { char buf[1000]; sprintf(buf, "%s [%c] %s", it->date, it->mood == HAPPY ? 'H' : it->mood == ANGRY ? 'A' : it->mood == SAD ? 'S' : 'J', it->text.c_str()); outtextxy(30, y, buf); y += 20; } } // 根据鼠标坐标判断是否点击了标签 int getClickedLabel(int x, int y) { for (int i = 0; i < labelClickAreas.size(); i++) { if (x >= labelClickAreas[i].x && x <= labelClickAreas[i].x + labelClickAreas[i].width && y >= labelClickAreas[i].y && y <= labelClickAreas[i].y + labelClickAreas[i].height) { return i; } } return -1; } // 判断是否点击了保存按钮 bool isClickedSaveButton(int x, int y) { return x >= saveClickArea.x && x <= saveClickArea.x + saveClickArea.width && y >= saveClickArea.y && y <= saveClickArea.y + saveClickArea.height; } // 判断是否点击了历史记录按钮 bool isClickedHistoryButton(int x, int y) { return x >= historyClickArea.x && x <= historyClickArea.x + historyClickArea.width && y >= historyClickArea.y && y <= historyClickArea.y + historyClickArea.height; } // 处理鼠标事件 void handleMouseEvent(MOUSEMSG msg) { if (msg.uMsg == WM_LBUTTONDOWN) { int labelIndex = getClickedLabel(msg.x, msg.y); if (labelIndex != -1) { // 点击了标签 setfillcolor(YELLOW); setlinecolor(BLACK); solidroundrect(LABEL_X + labelIndex * (LABEL_WIDTH + LABEL_MARGIN), LABEL_Y, LABEL_X + labelIndex * (LABEL_WIDTH + LABEL_MARGIN) + LABEL_WIDTH, LABEL_Y + LABEL_HEIGHT, 10, 10); } else if (isClickedSaveButton(msg.x, msg.y)) { // 点击了保存按钮 Record record; record.mood = static_cast<Mood>(labelIndex); char* date = getCurrentDate(); strcpy(record.date, date); free(date); record.text = getinput(); history.push_back(record); cleardevice(); drawTextBox(); drawLabels(); drawButtons(); } else if (isClickedHistoryButton(msg.x, msg.y)) { // 点击了历史记录按钮 cleardevice(); drawHistory(); while (!kbhit()); cleardevice(); drawTextBox(); drawLabels(); drawButtons(); } } } int main() { initgraph(WIDTH, HEIGHT); setbkcolor(WHITE); cleardevice(); drawTextBox(); drawLabels(); drawButtons(); settextcolor(BLACK); setbkmode(TRANSPARENT); settextstyle(20, 0, _T("微软雅黑")); outtextxy(30, 10, _T("请选择情绪标签,输入文本,按回车保存")); settextstyle(16, 0, _T("微软雅黑")); while (true) { MOUSEMSG msg = GetMouseMsg(); handleMouseEvent(msg); } closegraph(); return 0; } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值