博客
关于我
PTA L1-027 出租 (20 分)
阅读量:282 次
发布时间:2019-03-01

本文共 1173 字,大约阅读时间需要 3 分钟。

?????????????

????????????????????????????????????????????????????arr?index?arr???????????????index????????????

?????arr??????????????????????index?????????????????????????????18013820100?arr????8,3,2,1,0??index?????3,0,4,3,1,0,2,4,3,4,4?

???????????????????????11?????????????????????????????

  • ????????????????arr???
  • ????????index??
  • ??arr?index?????
  • ???????????

    #include 
    #include
    #include
    #include
    using namespace std;int main() { string s; while (cin >> s) { vector
    a(11), b(11); for (int i = 0; i < 11; ++i) { a[i] = s[i] - '0'; b[i] = i; } sort(a.begin(), a.end(), greater
    ()); for (int i = 0; i < 11; ++i) { if (find(b.begin(), b.end(), a[i]) != b.end()) { b.erase(find(b.begin(), b.end(), a[i]), 1); } } cout << "int[] arr = new int[" << arr.size() << "][" << arr << "];" << endl; cout << "int[] index = new int[" << b.size() << "][" << b << "];" << endl; } return 0;}

    ??????????????????????????arr?index??????????????????????a?????a??????????????????????index??????????????????????????????????????

    转载地址:http://qrvo.baihongyu.com/

    你可能感兴趣的文章
    PhpStorm配置远程xdebug
    查看>>
    phpstudy+iis搭建php项目
    查看>>
    phpStudy安装教程
    查看>>
    phpstudy搭建网站,通过快解析端口映射外网访问
    查看>>
    phpstudy站点域名管理
    查看>>
    phpunit
    查看>>
    PHPUnit单元测试对桩件(stub)和仿件对象(Mock)的理解
    查看>>
    phpweb成品网站最新版(注入、上传、写shell)
    查看>>
    phpWhois 项目推荐
    查看>>
    Redis事务详解,吃透数据库没你想的那么难
    查看>>
    phpwind部署问题
    查看>>
    PHP_CodeIgniter Github实现个人空间
    查看>>
    php_crond:一个基于多进程的定时任务系统-支持秒粒度的任务配置
    查看>>
    PHP__call __callStatic
    查看>>
    PHP——修改数据库1
    查看>>
    PHP——封装Curl请求方法支持POST | DELETE | GET | PUT 等
    查看>>
    PHP——底层运行机制与原理
    查看>>
    php一句话图片运行,【后端开发】php一句话图片木马怎么解析
    查看>>
    PHP三方登录,移动端与服务端交互
    查看>>
    Redis事务深入解析和使用
    查看>>