Check out example codes for "ios base sync with stdio". It will help you in understanding the concepts better.

Code Example 1

ios_base::sync_with_stdio(false);
cin.tie(NULL);

Code Example 2

cin.tie(NULL);

Code Example 3

ios_base::sync_with_stdio(false);

Learn ReactJs, React Native from akashmittal.com