Advertisement
Zeinab_Hamdy

Untitled

Dec 11th, 2022
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.46 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define ull unsigned ll
  5. #define nl "\n"
  6. #define sz(x) x.size()
  7. #define NumOfDigit(w) log10(w) + 1
  8. #define fill(arr, val)  memset(arr, val , sizeof(arr))
  9. #define PI 3.141592654
  10. #define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
  11. #define all(v) v.begin(), v.end()
  12. #define rall(v) v.rbegin(), v.rend()
  13. #define fi first
  14. #define se second
  15. #define cin(v) for (auto&i:v) cin >> i;
  16. #define cout(v) for (auto&i:v) cout << i << " ";
  17. #define fixed(n) fixed << setprecision(n)
  18. #define MOD  1000000007
  19.  
  20.  
  21. void IO(){
  22.     ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  23. }
  24. void files(){
  25.     //freopen("filename.in" , "r" ,stdin);
  26.             #ifndef ONLINE_JUDGE
  27.             freopen("input.txt", "r", stdin);  freopen("output.txt", "w", stdout);
  28.             #endif
  29. }
  30.  
  31.  
  32. void solve(){
  33.  
  34. string s ;
  35. cin >> s ;
  36. if(sz(s) !=8) return void(cout <<"No");
  37. int n=sz(s);
  38. if(s[0]>='A' and s[n-1] >='A' and s[0]<='Z' and s[n-1] <='Z' and
  39. s[1]>='1' and s[1] <='9' and s[2]>='0' and s[2] <='9' and
  40. s[3]>='0' and s[3] <='9' and s[4]>='0' and s[4] <='9' and
  41. s[5]>='0' and s[5] <='9' and s[6]>='0' and s[6] <='9'
  42. )
  43. cout <<"Yes";
  44. else cout <<"No";
  45.  
  46.  
  47. }
  48.  
  49.  
  50. int main(){
  51.                  IO();    //     files();
  52.                  
  53.            
  54.     int testCase=1;  // one test case
  55.       // cin >> testCase ;      
  56.  while(testCase--)
  57.         solve();  // my code
  58.        
  59.     return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement