2015年第六届蓝桥杯CC++ B组国赛 —— 第一题:积分之迷

    xiaoxiao2022-07-12  153

    标题:积分之迷

    小明开了个网上商店,卖风铃。共有3个品牌:A,B,C。 为了促销,每件商品都会返固定的积分。

    小明开业第一天收到了三笔订单: 第一笔:3个A + 7个B + 1个C,共返积分:315 第二笔:4个A + 10个B + 1个C,共返积分:420 第三笔:A + B + C,共返积分…

    你能算出第三笔订单需要返积分多少吗?

    请提交该整数,不要填写任何多余的内容。

    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. .^ */ /* Procedural objectives: Variables required by the program: Procedural thinking: Functions required by the program: Determination algorithm: Determining data structure: */ /* 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(){ /* 3*A+7*B+1*C=315 4*A+10*B+1*C=420 ? A+B+C=? ? */ for(int A=1;A<316;A++){ for(int B=1;B<316;B++){ for(int C=1;C<316;C++){ if((3*A+7*B+1*C==315)&&(4*A+10*B+1*C==420)) cout<<"A="<<A<<" B="<<B<<" C="<<C<<" A+B+C="<<A+B+C<<endl; } } } return 0; } Alex 007 认证博客专家 机器学习 NLP TensorFlow 我是 Alex 007,一个热爱计算机编程和硬件设计的小白。为啥是007呢?因为叫 Alex 的人太多了,再加上每天007的生活,Alex 007就诞生了。如果你喜欢我的文章的话,给个三连吧!
    最新回复(0)