Untitled
unknown
plain_text
2 years ago
408 B
4
Indexable
#include<iostream>
using namespace std;
int main()
{
double a, c;
int b;
cout << "введите число: " << endl;
cin >> a;
b = (int)a;
c = a - b;
string t = to_string(c);
int pos = int(t.find("."));
string otv = t.substr(pos + 1);
cout << "Целое число: " << b << '\n' << "Дробное число: " << c << " " << "или" << " " << otv << endl;
}
Editor is loading...