<代码收藏>动态生成数组

#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
 
void oneArray()
{
     
    int size=rand()%10;
    int* pint=new int[size];
    for(int i=0;i<size;++i)
    {
        pint[i]=rand()%100;
    }
    cout<<"one array is "<<endl;
    for(int i=0;i<size;++i)
    {
        cout<<pint[i]<<"\t";
    }
    cout<<endl;
    delete []pint;
}
 
void twoArray()
{
    int row=rand()%10;
    int column=rand()%10;
    cout<<"row is "<<row<<" column is "<<column<<endl;
    cout<<"two array is"<<endl;
    int** p=new int*[row];
    for(int i=0;i<row;++i)
    {
        p[i]=new int[column];
    }
    for(int i=0;i<row;++i)
    {
        for(int j=0;j<column;++j)
        {
            p[i][j]=rand()%100;
        }
    }
     
    for(int i=0;i<row;++i)
    {
        for(int j=0;j<column;++j)
        {
            cout<<p[i][j]<<"\t";
        }
        cout<<endl;
    }
    cout<<"delete array"<<endl;
    for(int i=0;i<row;++i)
    {
        delete []p[i];
    }
    delete []p;
}
void threeArray()
{
    cout<<"three array"<<endl;
    int height=rand()%10;
    int row=rand()%10;
    int column=rand()%10;
    cout<<"height is "<<height<<" row is "<<row<<" column is "<<column<<endl;
    int*** p=new int**[height];
    for(int i=0;i<height;i++)
    {
        p[i]=new int*[row];
    }
    for(int i=0;i<height;++i)
    {
        for(int j=0;j<row;++j)
        {
            p[i][j]=new int[column];
        }
    }
 
    for(int i=0;i<height;++i)
        for(int j=0;j<row;++j)
            for(int k=0;k<column;++k)
            {
                p[i][j][k]=rand()%100;
            }
 
    for(int i=0;i<height;++i)
    {
        for(int j=0;j<row;++j)
        {
            for(int k=0;k<column;++k)
            {
                cout<<p[i][j][k]<<"\t";
            }
            cout<<endl;
        }
        cout<<endl<<endl;
    }
    cout<<"delete three array"<<endl;
    for(int i=0;i<height;++i)
    {
        for(int j=0;j<row;++j)
        {
            delete []p[i][j];
        }
    }
    for(int i=0;i<height;i++)
    {
        delete []p[i];
    }
    delete []p;
}
 
 
void main()
{
    srand(unsigned(time(NULL)));
    oneArray();
    twoArray();
    threeArray();
    int aa;
    cin>>aa;
}

export default [ { name: '', icon: 'UnorderedListOutlined', path: '/home', component: './Home', }, { name: '工具合集', icon: 'ToolOutlined', path: '/tools', routes: [ { name: '助力小工具', path: '/tools/assist/list', component: './AssistList', access: 'assistAccess', }, ], }, { path: '/form', routes: [ { name: '表单详情', path: '/form/detail', component: './FormDetail', parentKeys: ['/tools/formManage'], }, { name: '表单详情', path: '/form/preview', component: './FormPreview', parentKeys: ['/tools/formManage'], }, ], }, // 嵌套菜单,父路径需要配置path,否则嵌套菜单下面的一级菜单不生效 // 兼容历史数据的解决方案 // ****** WARNING ****** // 使用 redirect 会导致 history.back 出问题 // 请使用全路由 { path: '/prizepool/list', component: './PrizePoolList', wrappers: ['@/wrappers/redirectComp'], }, { path: '/prizepool/detail', component: './PrizePoolDetail', wrappers: ['@/wrappers/redirectComp'], }, { path: '/sitemanage/list', component: './SiteManageList', wrappers: ['@/wrappers/redirectComp'], }, { path: '/prizetype/list', component: './PrizeTypeList', wrappers: ['@/wrappers/redirectComp'], }, { path: '/prizetype/detail', component: './PrizeTypeDetail', wrappers: ['@/wrappers/redirectComp'], }, { path: '/oldprizepool/list', component: './OldPrizePoolList', wrappers: ['@/wrappers/redirectComp'], }, { path: '/oldprizepool/detail', component: './OldPrizePoolDetail', wrappers: ['@/wrappers/redirectComp'], }, { path: '/', redirect: '/home' }, { component: './404' }, ]; 在助力小工具同级别,加个数据库工具 代码如下import { Button, Divider, Input, Layout, Menu, Table, Typography, } from '@arco-design/web-react'; import { IconApps, IconList, IconStar, IconUser, } from '@arco-design/web-react/icon'; import { useState } from 'react'; const MenuItem = Menu.Item; const Sider = Layout.Sider; const Header = Layout.Header; const Content = Layout.Content; function App() { const [actName, setActName] = useState(''); const columns = [ { title: '标识符名称', dataIndex: 'name' }, { title: '站点', dataIndex: 'site' }, { title: '分支名称', dataIndex: 'branch' }, { title: '操作', render: () => ( <> <Button type="text">编辑</Button> <Button type="text" status="danger"> 删除 </Button> </> ), }, ]; const data1 = [ { name: 'easywinus', site: 'us', branch: 'A' }, { name: 'easywinus', site: 'us', branch: 'B' }, ]; const data2 = [ { name: 'easywinus', site: 'de', branch: 'C' }, { name: 'easywinus', site: 'us', branch: 'D' }, ]; return ( <Layout style={{ height: '100vh' }}> {/* 左侧菜单 */} <Sider breakpoint="lg" width={200} style={{ background: '#fff' }}> <div style={{ padding: '16px', fontWeight: 'bold', fontSize: '18px' }}> Arco Pro </div> <Menu defaultSelectedKeys={['2']}> <MenuItem key="1"> <IconApps /> 配置管理 </MenuItem> <MenuItem key="2"> <IconList /> 数据库管理 </MenuItem> <MenuItem key="3"> <IconList /> 查询管理 </MenuItem> <MenuItem key="4"> <IconList /> 查询列表 </MenuItem> <MenuItem key="5"> <IconStar /> 我的查询 </MenuItem> <MenuItem key="6"> <IconStar /> 我的收藏 </MenuItem> <MenuItem key="7"> <IconUser /> 个人中心 </MenuItem> </Menu> </Sider> {/* 右侧内容 */} <Layout> <Header style={{ background: '#fff', padding: 16 }}> <Typography.Title heading={5}>fi开局数据库校验</Typography.Title> </Header> <Content style={{ padding: '16px', background: '#f5f5f5' }}> {/* 查询框 */} <div style={{ display: 'flex', gap: 8, marginBottom: 20 }}> <Input placeholder="act_name_en 请输入" value={actName} onChange={setActName} /> <Button type="primary">查询</Button> </div> {/* 第一段结果 */} <Typography.Paragraph> 查询语句:SELECT act_name_en, site, abt_brance FROM activity_base_data_publish WHERE act_name_en ="easywinus" </Typography.Paragraph> <Table columns={columns} data={data1} pagination={false} /> <Divider /> {/* 第二段结果 */} <Typography.Paragraph> 查询语句:SELECT act_name_en, site, abt_brance FROM activity_main_data WHERE act_name_en ="easywinus" </Typography.Paragraph> <Table columns={columns} data={data2} pagination={false} /> </Content> </Layout> </Layout> ); } export default App;
09-05
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <link rel="stylesheet" type="text/css" href="css/bootstrap.css" /> <link rel="stylesheet" type="text/css" href="css/bootstrap-icons.css" /> <link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/table.css" /> <style> .bg-f4f6f7 { background-color: #f4f6f7; } </style> </head> <body> <div> <div class="bg-primary d-flex justify-content-between align-items-center row p-3"> <div class="h1 text-white ml-5">Æon</div> <div class="row mr-5"> <img src="img/管理员.png" class="gly mr-1" /> <div>管理员</div> </div> </div> <div class="row bg-f4f6f7"> <div class="sidebar"> <ul class="nav flex-column px-2 py-3"> <li class="nav-item"> <a class="nav-link " href="#" data-template="home"> 首页 </a> </li> <!-- 用户管理 --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 用户管理 </a> <ul class="dropdown-menu" aria-labelledby="userDropdown"> <li><a class="dropdown-item" href="#">封禁/解除用户</a></li> <li><a class="dropdown-item" href="#" data-template="users">用户列表</a></li> <li><a class="dropdown-item" href="#">用户行为记录</a></li> </ul> </li> <!-- 歌手管理 --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="singerDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 歌手管理 </a> <ul class="dropdown-menu" aria-labelledby="singerDropdown"> <li><a class="dropdown-item" href="#">封禁/解封歌手</a></li> <li><a class="dropdown-item" href="#" data-template="geshou">歌手歌曲</a></li> </ul> </li> <!-- 歌曲内容管理 --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="songDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 歌曲内容管理 </a> <ul class="dropdown-menu" aria-labelledby="songDropdown"> <li><a class="dropdown-item" href="#">歌曲收藏</a></li> <li><a class="dropdown-item" href="#">评论管理</a></li> <li><a class="dropdown-item" href="#">歌曲信息</a></li> <li><a class="dropdown-item" href="#" data-template="gedan">歌单管理</a></li> </ul> </li> <!-- 社区管理 --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="communityDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 社区管理 </a> <ul class="dropdown-menu" aria-labelledby="communityDropdown"> <li><a class="dropdown-item" href="#" data-template="shequ">帖子审核</a></li> <li><a class="dropdown-item" href="#">帖子发布</a></li> <li><a class="dropdown-item" href="#">举报处理</a></li> </ul> </li> <!-- 数据分析 --> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="analysisDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 数据分析 </a> <ul class="dropdown-menu" aria-labelledby="analysisDropdown"> <li><a class="dropdown-item" href="#" data-template="data">播放量分析</a></li> <li><a class="dropdown-item" href="#">用户分析</a></li> </ul> </li> <!-- 管理员管理 --> <li class="nav-item"> <a class="nav-link" href="#" data-template="guanli"> 管理员管理 </a> </li> <!-- 系统管理 --> <li class="nav-item"> <a class="nav-link" href="#"> 系统管理 </a> </li> </ul> </div> <div class="m-2" id="contentArea"></div> </div> <template id="homeTpl" class=""> <div class="daohang"> <h5>首页</h5> </div> <div class="homet"> <div class="hometl"> <h6>用户数量</h6> <div class="yonghu mt-4"> <div>新增用户数<a>{{usernum}}</a></div> <div>总用户数<a>{{totalusernum}}</a></div> </div> </div> <div class="hometr"> <h6>歌手数量</h6> <div class="geshou mt-4"> <div>总歌手数<a>{{singernum}}</a></div> </div> </div> </div> <div class="homeb"> <div class="homebl"> <h6>代办事项</h6> <div class="daiban mt-4"> <div>无</div> </div> </div> <div class="homebr"> <div class="homebrt"> <h6>快捷入口</h6> <div class="d-flex justify-content-around mt-4"> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> <div class="kuaijie"> <img src="img/管理员.png" style="height: 40px;width: 40px;" /> <div>用户</div> </div> </div> </div> <div class="homebrb"> <h6>访问统计</h6> </div> </div> </div> </template> <template id="usersTpl"> <div class="daohang"> <h5>首页->用户</h5> </div> <div class="user"> <div class="sousuo"> <div>用户名:</div> <input placeholder="查询内容" class="pt-2 pb-2 rounded" /> <div class="border border-secondary rounded p-2">查询</div> </div> <div class="zs"> <div class="border border-secondary rounded p-2">新增</div> <div class="border border-secondary rounded p-2">删除</div> </div> <table id="userTable" style="margin-top: 10px;"> <thead> <tr> <th>选择</th> <th>索引</th> <th>用户名</th> <th>头像</th> <th>性别</th> <th>账号</th> <th>操作</th> </tr> </thead> <tbody id="tableBody"> <!-- 数据将通过JavaScript动态加载 --> </tbody> </table> </div> </template> <template id="singerTpl"> <div class="daohang"> <h5>首页->歌手</h5> </div> <div class="singer"> <div class="sousuo"> <div>歌手/歌曲:</div> <input placeholder="查询内容" class="pt-2 pb-2 rounded" /> <div class="border border-secondary rounded p-2">查询</div> </div> <div class="zs"> <div class="border border-secondary rounded p-2">新增</div> <div class="border border-secondary rounded p-2">删除</div> </div> <table id="userTable" style="margin-top: 10px;"> <thead> <tr> <th><input type="checkbox" id="selectAll" class="checkbox"></th> <th>索引</th> <th>歌手</th> <th>照片</th> <th>性别</th> <th>歌曲</th> <th>操作</th> </tr> </thead> <tbody id="tableBody"> <tr> <td colspan="7" class="loading">加载中...</td> </tr> </tbody> </table> </div> </template> <template id="gedanTpl"> <div class="daohang"> <h5>首页->歌单</h5> </div> <div class="gedan"> <div class="sousuo"> <div>歌单:</div> <input placeholder="查询内容" class="pt-2 pb-2 rounded" /> <div class="border border-secondary rounded p-2">查询</div> </div> <div class="zs"> <div class="border border-secondary rounded p-2">新增</div> <div class="border border-secondary rounded p-2">删除</div> </div> <table id="musicTable" style="margin-top: 10px;"> <thead> <tr> <th>索引</th> <th>歌曲名称</th> <th>海报</th> <th>歌曲分类</th> <th>歌手</th> <th>视频</th> <th>操作</th> </tr> </thead> <tbody id="tableBody"> <tr> <td colspan="7" class="loading">加载中...</td> </tr> </tbody> </table> </div> </template> <template id="shequTpl"> <div class="daohang"> <h5>首页->社区</h5> </div> <div class="shequ"> <div class="sousuo"> <div>歌单:</div> <input placeholder="查询内容" class="pt-2 pb-2 rounded" /> <div class="border border-secondary rounded p-2">查询</div> </div> <div class="zs"> <div class="border border-secondary rounded p-2">新增</div> <div class="border border-secondary rounded p-2">删除</div> </div> <table id="shequTable" style="margin-top: 10px;"> <thead> <tr> <th><input type="checkbox" id="selectAll"></th> <th>编号</th> <th>帖子标题</th> <th>发布人</th> <th>发布时间</th> <th>更新时间</th> <th>审核时间</th> <th>状态</th> <th>操作</th> </tr> </thead> <tbody id="tableBody"> <tr> <td colspan="9" class="loading">加载中...</td> </tr> </tbody> </table> </div> </template> <template id="shujuTpl"> <div class="daohang"> <h5>播放量</h5> </div> <div class="shuju"> <div class="sjl"> <h6>平台总播放量分析</h6> </div> <div class="sjr"> <div class="sjrt"> 歌手播放量 </div> <div class="sjrb"> 当前趋势分析 </div> </div> </div> </template> <template id="guanliTpl"> <div class="daohang"> <h5>管理员管理</h5> </div> <div class="guanliyuan"> <div class="gll"> <h6>管理员</h6> </div> <div class="glr"> </div> </div> </template> </div> <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.js"></script> <script src="js/cebianlan.js"></script> <!-- <script src="js/shequ.js"></script> <script src="js/gedan.js"></script> <script src="js/geshou.js"></script> <script src="js/yonghu.js"></script> --> </body> </html>在js中新增20条用户数据,能够进行增删设置,搜索设置
06-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值