猜年龄

结果 :10

 1 #include<iostream>
 2 using namespace std;
 3 
 4 int main()
 5 {
 6     int a,b;
 7     for(a=1 ; ; a++)
 8     {
 9         for(b=a+1 ; b<=a+8 ; b++)
10         {
11             if(a*b == (a+b)*6)
12             {
13                 cout<<a<<endl;
14             //    cout<<b<<endl;
15                 return 0;
16             } 
17         }
18     }
19 }
View Code

相关文章:

  • 2022-12-23
  • 2021-05-31
  • 2021-11-07
  • 2021-12-07
  • 2022-12-23
  • 2021-11-29
  • 2022-02-09
  • 2021-10-05
猜你喜欢
  • 2021-09-30
  • 2021-04-15
  • 2022-01-02
  • 2021-12-13
  • 2021-11-27
  • 2021-07-07
  • 2022-12-23
相关资源
相似解决方案