Advertisement
kostes

Untitled

Mar 12th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5. int main()
  6. {
  7. unsigned int i;
  8. string st;
  9. cout<<"vvedite stroku - St"<<endl;
  10. getline(cin,st);
  11. int f=0,s=0;
  12. int n=st.length();
  13. int now=0;
  14. for(int i=0;i<n;i++)
  15. {
  16. if(st[i]=='/')
  17. now=1;
  18. else if(now==0)
  19. {
  20. f=f*10+(st[i]-'0');
  21. }
  22. else
  23. {
  24. s=s*10+(st[i]-'0');
  25. }
  26. }
  27. int a=f/s;
  28. cout<<a;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement