8 条题解

  • 2
    @ 2023-3-8 20:35:59
    #include <iostream>
    using namespace std;
    int main()
    {
    for(int i = 2;i <= 8;i+=2)
    {
    cout << i << "0" << i << endl;
    cout << i << "1" << i << endl;
    cout << i << "2" << i << endl;
    cout << i << "3" << i << endl;
    cout << i << "4" << i << endl;
    cout << i << "5" << i << endl;
    cout << i << "6" << i << endl;
    cout << i << "7" << i << endl;
    cout << i << "8" << i << endl;
    cout << i << "9" << i << endl;
    }
    return 0;
    }
    
    没人写题解?
    
  • 1
    @ 2023-10-21 17:30:48
    #include <bits/stdc++.h> 
    using namespace std;
    int main()
    {
        for(int i = 100; i <= 999; i++)
        {
            int a, c;
            a = i / 100;
            c = i % 10;
            if(a == c and c % 2 == 0)
            {
                cout << i << endl;
            }
        }
        return 0;
    }
    
    • 1
      @ 2023-10-1 10:35:47

      方法:

      #include <iostream>
      using namespace std;
      int main(){
          for(int i=100;i<=999;i++)if(i%2==0&&i/100==i%10)cout<<i<<endl;
          return 0;
      }
      
      • 0
        @ 2023-11-18 14:59:16

        #include <bits/stdc++.h> using namespace std; int main() { for (int i = 100;i < 1000;i++) { if ((i % 10 == i / 100) && (i % 2 == 0)) { cout << i << endl; } } return 0; }

        • 0
          @ 2023-8-19 19:41:47

          半夜打卡第三题

          #include <bits/stdc++.h>
          using namespace std;
          int main()
          {
              int n = 202;//最小的回文偶数是202
              while (1)
              {
                  if (n > 898) break;//最大的回文偶数是898,大于898可以直接终止循环
                  if ((n / 100 == n % 10) && (n % 2 == 0)) cout << n << endl;//如果百位等于各位且n为偶数,打印n
                  n++;
              }
              return 0;
          }
          

          别问我为什么不用for👀️

          • 0
            @ 2023-7-24 10:31:19

            #include <iostream> using namespace std; int main() { for(int i = 2;i <= 8;i+=2) { cout << i << "0" << i << endl; cout << i << "1" << i << endl; cout << i << "2" << i << endl; cout << i << "3" << i << endl; cout << i << "4" << i << endl; cout << i << "5" << i << endl; cout << i << "6" << i << endl; cout << i << "7" << i << endl; cout << i << "8" << i << endl; cout << i << "9" << i << endl; } return 0; }

            • 0
              @ 2023-4-20 22:07:52
              #include<bits/stdc++.h>
              using namespace std;
              int main()
              {
                  for (int i=100;i<=999;i++)
                      if (i%10==i/100&&i%2==0)
                          cout<<i<<'\n';
                  return 0;
              }
              
              • -1
                @ 2023-7-20 20:44:55
                #include <bits/stdc++.h>
                using namespace std;
                int main(){
                    int a, b;
                    for (int i = 202; i <= 898; i++){
                        a = i % 10;
                        b = i / 100;
                        if (a == b && b % 2 == 0) cout << i << "\n";
                    }
                }
                
                • 1

                信息

                ID
                389
                时间
                1000ms
                内存
                16MiB
                难度
                3
                标签
                递交数
                142
                已通过
                80
                上传者