2 solutions

  • 2

    #include<bits/stdc++.h> using namespace std; int a; int main() { cin >> a; if (a >= 10 && a <= 99)cout << 1; else cout << 0; return 0; }

    • 1
      @ 2025-2-6 1:36:22

      方案 11 :整数 ++ if

      #include <bits/stdc++.h>
      using namespace std;
      int n;
      int main() {
      	cin >> n;
      	if (n >= 10 && n <= 99) cout << 1;
      	else cout << 0;
      	return 0;
      }
      

      方案 22stringn.length()

      #include <bits/stdc++.h>
      using namespace std;
      string n;
      int main() {
      	cin >> n;
      	if (n.length() == 2) cout << 1;
      	else cout << 0;
      	return 0;
      }
      
      • 1

      Information

      ID
      4490
      Time
      1000ms
      Memory
      128MiB
      Difficulty
      1
      Tags
      (None)
      # Submissions
      154
      Accepted
      104
      Uploaded By