年龄问题

s夫人一向很神秘。这会儿有人问起她的年龄,她想了想说:
"20年前,我丈夫的年龄刚好是我的2倍,而现在他的年龄刚好是我的1.5倍"。

你能算出s夫人现在的年龄吗?

注意,需要提交的是一个整数,不要填写任何多余的内容。

答案:

代码:

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>

using namespace std;

int main() {
    for(int i = 0;i <= 100;i += 2) {
        if((i * 2 + 20) == (i / 2 + 10) * 3) printf("%d",i + 20);
    }
}
原文地址:https://www.cnblogs.com/8023spz/p/10772788.html