2 solutions

  • 1
    @ 2024-4-6 0:14:07
    #include <iostream>
    using namespace std;
    
    int main() {
        int n;
        cin >> n;
        int count = 0;
        for (int i = 0; i < n; i++) {
            int num;
            cin >> num;
            int a = num % 10;
            int b = (num / 10) % 10;
            int c = (num / 100) % 10;
            int d = num / 1000;
            if (a - d - b - c > 0) {
                count++;
            }
        }
        cout << count << endl;
        return 0;
    }
    
    • 1
      @ 2024-4-6 0:13:38

      5 1234 1349 6119 2123 5017

      • 1

      Information

      ID
      6883
      Time
      1000ms
      Memory
      128MiB
      Difficulty
      1
      Tags
      # Submissions
      10
      Accepted
      7
      Uploaded By