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

    你可能感兴趣的文章
    Python - 在应用程序中显示 Web 浏览器/iframe
    查看>>
    Python - 如何使用管道执行shell命令,但没有‘shell = True‘?
    查看>>
    Python - 如何使这个不可腌制的对象可腌制?
    查看>>
    Python - 如何在 Windows 10 上完全卸载 Anaconda?
    查看>>
    python - 如何并行化python numpy中的总和计算?
    查看>>
    Python - 如何解析 xml 响应并将元素值存储在变量中?
    查看>>
    Python - 安装了扩展的远程 Webdriver
    查看>>
    python - 将字符串中的日期与今天的日期进行比较
    查看>>
    python - 数据描述符(class 内置 get/set/delete方法 )
    查看>>
    Python - 根据值绘制彩色网格
    查看>>
    Python - 正则表达式在括号之间获取数字
    查看>>
    Python - 正则表达式在括号之间获取数字
    查看>>
    Python - 正则表达式在括号之间获取数字
    查看>>
    Python - 类 __hash__ 方法和集合
    查看>>
    Python - 轻松将文本文件内容转换为字典值/键
    查看>>
    Python - 递归和列表
    查看>>
    python -- 小数据池 is和 == 再谈编码
    查看>>
    Python -- 算法实现
    查看>>
    python --- 元组(tuple)
    查看>>
    python --- 列表(list)
    查看>>