zoukankan      html  css  js  c++  java
  • 2017年第八届蓝桥杯 —— 训练题目 —— 三人年龄

    2.三人年龄

    三个神秘蒙面人来访F博士。

    博士询问他们年龄时,他们说:我们中年龄最小的不超过19岁。

    我们3人年龄总和为70岁。

    且我们三人年龄的乘积是所有可能情况中最大的。

    请帮助F博士计算他们的年龄,从小到大排列,用逗号分开。

    code

    /*
                                    ^....0
                                   ^ .1 ^1^
                                   ..     01
                                  1.^     1.0
                                 ^ 1  ^    ^0.1
                                 1 ^        ^..^
                                 0.           ^ 0^
                                 .0            1 .^
                                 .1             ^0 .........001^
                                 .1               1. .111100....01^
                                 00             ^   11^        ^1. .1^
                                 1.^                              ^0  0^
                                   .^                                 ^0..1
                                   .1                                   1..^
                                 1 .0                                     ^  ^
                                  00.                                     ^^0.^
                                  ^ 0                                     ^^110.^
                              0   0 ^                                     ^^^10.01
                       ^^     10  1 1                                      ^^^1110.1
                       01     10  1.1                                      ^^^1111110
                       010    01  ^^                                        ^^^1111^1.^           ^^^
                       10  10^ 0^ 1                                            ^^111^^^0.1^       1....^
                        11     0                                               ^^11^^^ 0..  ....1^   ^ ^
                        1.     0^                                               ^11^^^ ^ 1 111^     ^ 0.
                       10   00 11                                               ^^^^^   1 0           1.
                       0^  ^0  ^0                                                ^^^^    0            0.
                       0^  1.0  .^                                               ^^^^    1 1          .0
                       ^.^  ^^  0^                             ^1                ^^^^     0.         ^.1
                       1 ^      11                             1.                ^^^     ^ ^        ..^
                      ^..^      ^1                             ^.^               ^^^       .0       ^.0
                      0..^      ^0                              01               ^^^       ..      0..^
                     1 ..        .1                             ^.^              ^^^       1 ^  ^0001
                    ^  1.        00                              0.             ^^^        ^.0 ^.1
                    . 0^.        ^.^                             ^.^            ^^^         ..0.0
                   1 .^^.         .^                  1001        ^^            ^^^         . 1^
                   . ^ ^.         11                0.    1         ^           ^^          0.
                    0  ^.          0              ^0       1                   ^^^          0.
                  0.^  1.          0^             0       .1                   ^^^          ..
                  .1   1.          00            .        .1                  ^^^           ..
                 1      1.         ^.           0         .^                  ^^            ..
                 0.     1.          .^          .         0                                  .
                 .1     1.          01          .        .                                 ^ 0
                ^.^     00          ^0          1.       ^                                 1 1
                .0      00           .            ^^^^^^                                   .
                .^      00           01                                                    ..
               1.       00           10                                                   1 ^
              ^.1       00           ^.                                            ^^^    .1
              ..        00            .1                                        1..01    ..
             1.1         00           1.                                       ..^      10
            ^ 1^         00           ^.1                                      0 1      1
            .1           00            00                                       ^  1   ^
             .           00            ^.^                                        10^  ^^
           1.1           00             00                                              10^
           ..^           1.             ^.                                               1.
          0 1            ^.              00                 00                            .^
            ^            ^.              ^ 1                00   ^0000^     ^               01
         1 0             ^.               00.0^              ^00000   1.00.1              11
         . 1              0               1^^0.01                      ^^^                01
          .^              ^                1   1^^                                       ^.^
        1 1                                                                              0.
        ..                                                                              1 ^
         1                                                                               1
       ^ ^                                                                             .0
       1                                                                             ^ 1
       ..                                                          1.1            ^0.0
      ^ 0                                                           1..01^^100000..0^
      1 1                                                            ^ 1 ^^1111^ ^^
      0 ^                                                             ^ 1      1000^
      .1                                                               ^.^     .   00
      ..                                                                1.1    0.   0
      1.                                                                  .    1.   .^
      1.                                                                 1    1.   ^0
     ^ .                                                                 ^.1 00    01
     ^.0                                                                  001.     .^
     */
    // VB_king —— 2017_Training topics_Result filling in the blanks_2.cpp created by VB_KoKing on 2019-05-05:08.
    /* Procedural objectives:
    
     Variables required by the program:
    
     Procedural thinking:
    
     Functions required by the program:
    
    */
    /* My dear Max said:
    "I like you,
    So the first bunch of sunshine I saw in the morning is you,
    The first gentle breeze that passed through my ear is you,
    The first star I see is also you.
    The world I see is all your shadow."
    
    FIGHTING FOR OUR FUTURE!!!
    */
    #include <iostream>
    
    using namespace std;
    
    int main() {
        for (int i = 1; i <= 19; i++)
            for (int j = 1; j < 70; j++)
                for (int k = 1; k < 70; k++)
                    if (i + j + k == 70 && i * j * k > 12300)
                        cout << "i=" << i << " j=" << j << " k=" << k << " i*j*k=" << i * j * k << endl;
        return 0;
    }
    

    Answer

    19,25,26

  • 相关阅读:
    VUE 腾讯云 web端上传视频SDK 上传进度无法显示
    SQL Server 连接数据库报错 (ObjectExplorer)
    Docker 下,搭建 SonarQube 环境 (数据库为 postgres)
    静态代码扫描工具
    windows10 中为文件添加让自己可以使用查看、修改、运行的权限
    mysql8.0.21下载安装详细教程,mysql安装教程
    C# 关于构造函数引证次序讨教
    c# winfrom 读取app.config 自定义节点
    如何在C#中将项目添加到列表中
    如何在C#实现日志功能
  • 原文地址:https://www.cnblogs.com/AlexKing007/p/12338354.html
Copyright © 2011-2022 走看看