博客
关于我
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/

    你可能感兴趣的文章
    php中绘制图像的手册,PHP图像图形处理入门教程(1/3)
    查看>>
    PHP中获取星期的几种方法
    查看>>
    Redis 限速器及问题
    查看>>
    php中高级基础知识点
    查看>>
    php中,如何将编译后的代码,反编译回去。
    查看>>
    php之aop实践
    查看>>
    PHP之APC缓存详细介绍(转)
    查看>>
    php之memcache,memcached
    查看>>
    php之引用
    查看>>
    PHP之数组和函数的基本教程
    查看>>
    UVa 10465 - Homer Simpson
    查看>>
    php九九乘法表加粗,PHP九九乘法表
    查看>>
    PHP二维数组将重复键值合并重组成三维数组
    查看>>
    PHP二维数组转换为一维数组
    查看>>
    PHP二维数组重组
    查看>>
    PHP交换两个变量值
    查看>>
    php代码执行完整流程介绍
    查看>>
    PHP代码格式化工具phpcf常见问题解决方案
    查看>>
    PHP使用3DES算法加密解密字符串
    查看>>
    PHP使用curl multi要注意的问题:每次使用curl multi同时并发多少请求合适
    查看>>