Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstring>
- #include<cstdlib>
- using namespace std;
- char s[11];
- int main()
- {
- int x,n;
- cin.getline(s,15);
- n=strlen(s);
- while(s[n]=='0')
- {
- s[n]=0;
- }
- x=atoi(s)+atoi(strchr(s,'.')+1);
- cout<<x;
- }
Add Comment
Please, Sign In to add comment