- #include <iostream>
-
#include <string>
-
#include <sstream>
-
-
-
using namespace std;
-
-
int main(){
-
double num;
-
stringstream s;
-
char str[512];
-
char c[512];
-
//cout.setf(ios_base::fixed, ios_base::floatfield); fixed-float
-
cout<<"Input a number: ";
-
cin >>num;
-
s << num;
-
s >> str;
-
sscanf(str,"%[0-9]",c);
-
if(strlen(str)!=strlen(c))
-
cout<<num<<" is a decimal number"<<endl;
-
else
-
cout<<num<<" is an integral number"<<endl;
-
return 0;
- }