Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int nrcif(int n)
- {
- int c;
- while(n!=0)
- {
- c++;
- n/=10;
- }
- return c;
- }
- int nrreal(int x, int y)
- {
- int a,i,p=1;
- double c;
- a = nrcif(y);
- for(i = 1; i <= a; i++)
- p*=10;
- c = x + y/p;
- return c;
- }
- int main()
- {
- cout << nrreal(12,543);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement