# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
499449 | 2021-12-28T12:42:11 Z | adam | Kaučuk (COCI21_kaucuk) | C++14 | 0 ms | 0 KB |
#include <bita/stdc++.h> using namespace std; int main() { string a,d; int n,x=0,y=0,z=0; cin>>n; for (int i=1;i<=n;i++) { cin>>a>>d; if (a=="section") { x++; y=0; z=0; } elae if (a=="subsection") { y++; z=0; } else { z++; } if (z>0) { cout<<x<<'.'<<y<<'.'<<z<<' '<<d<<endl;; } else if (y>0) { cout<<x<<'.'<<y<<' '<<d<<endl; } else { cout<<x<<' '<<d<<endl; } } return 0; }