AlenAntonelli

Ayuda_para_un_olvidadizo_Alen

May 12th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. ///Trello, Principiante, Ayuda para un olvidadizo
  2. #include <iostream> /// AlenAntonelli
  3. #include <vector>
  4. using namespace std;
  5. int main ()
  6. {
  7.     long aux=0, cc=0;
  8.     string v;
  9.     vector <int> c;
  10.     cin >> v;
  11.     for (long i=0; i<v.size(); i++)
  12.     {
  13.         if (v[i]=='*')
  14.         {
  15.             cc++;
  16.             if (cc!=1)
  17.                 c.push_back(aux);
  18.             aux=0;
  19.         }
  20.         else
  21.             aux++;
  22.     }
  23.  
  24.     for (int i=0; i<4; i++)
  25.         cout << c[i] <<endl;
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment