[1337] Dumb Typo

  • Hello everyone who is partcipate in the Fighting For 2014 Contest, I'm MatRush. This is the simplest problem today, no algorithm knowledge needed, But it's also the hardest problem today if you are not on the right track, so please do not waste your time here if you have no idea with it after many tries.
    I was writing some C++ code one day, and I typed this fragment:

    x = y * 2 + 1;

    But unfortunately I had a bug. When y was 10, I wanted x to be 19. To fix this, I changed the '+' to a '-'.
    After fixing this bug, I wrote some more code:

    x = y * 2245 + (y * 2 - 7);

    I had a another bug. When y was 79, I wanted x to be 8841. What single character can I change to make this work? Remember your first answer as "pos,new char". For example, the answer to the first bug would be "10,-": we're changing the 10th (start from 0th) character ('+') to '-'.
    Several days later.
    I can't believe I made the same mistake again! Still this childish and straightforward code.

    x = y * 2245 + (y * 2 - 7);

    This time I had an another different bug. When y was 79, I wanted x to be 13186. What single character can I change to make this work? Remember your second answer as "pos,new char". For example, the answer to the first bug would be "10,-": we're changing the 10th (start from 0th) character ('+') to '-'.
  • 输入
  • There is no input
  • 输出
  • Please submit your two answer in separate lines (two lines).
  • 样例输入
  • There is no input
  • 样例输出
  • Sorry, no sample output.
    But I give you a wrong output for sample format. Here it is.
    1,-
    2,+

模拟就能做出来。               10,*

                                                8 ,0

                             0代表不能改变,1代表只能变成0~9数字里的或者只能改变符号,2代表符号数字都能变

                                                                            x = y * 2245 + (y * 2 - 7)

                                                                            0 0 0 1 1221 1  0 1 1 1 1

 空格也是字符,且是从第0个算起。

#include<iostream>
using namespace std;
int main()
{
cout<<"10,*"<<endl;
cout<<"8,0"<<endl;

}


                                                                       

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值