Advertisement
semsem_elazazy

Untitled

Jul 1st, 2022
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. #include<utility>
  4. #include <queue>
  5. #include <vector>
  6. #include <iterator>
  7. #include <set>
  8. #define ll long long
  9. #define ull unsigned long long
  10. #define pi  3.14159
  11.  
  12. #define OO  2000000000
  13. //#define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
  14. using namespace std;
  15.  
  16.  
  17.  
  18. void yasmeen_fakhri(){
  19.   ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  20.   #ifndef ONLINE_JUDGE  
  21.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  22.   #endif
  23. }
  24.  
  25.  
  26.  
  27. int main() {
  28.    yasmeen_fakhri();
  29.  
  30. freopen("adam.in", "r", stdin);
  31.  
  32. int t; cin>>t;
  33.  
  34. while (t--){
  35.     string s;
  36.     cin>>s;
  37.     int n= s.size();
  38.     int c=0 ;
  39.     for(int i=0 ; i<n ; i++ ){
  40.         if(s[i] == 'D') break;
  41.         else c++;
  42.     }
  43.     cout<<c;
  44.    
  45.     if (t != 0) cout<<'\n';
  46. }
  47.    return 0;
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement