Untitled
Anonymous
plain_text
10/04/2023 9:46 AM
544 B
14
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...