SelinD

v55s2e5

Feb 19th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. #include<cstdlib>
  4. using namespace std;
  5. char s[11];
  6. int main()
  7. {
  8. int x,n;
  9. cin.getline(s,15);
  10. n=strlen(s);
  11. while(s[n]=='0')
  12. {
  13. s[n]=0;
  14. }
  15. x=atoi(s)+atoi(strchr(s,'.')+1);
  16. cout<<x;
  17. }
Add Comment
Please, Sign In to add comment