fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int i;
  6. double d;
  7. cin >> d;
  8. if (cin.fail()) // Проверка что нет некорректных знаков, например букв
  9. cout << "error" << endl;
  10. i = d;
  11. if (i != d)
  12. cout << "error" << endl;
  13.  
  14.  
  15. }
Success #stdin #stdout 0s 4176KB
stdin
3,2
stdout
Standard output is empty