I need to write a small program to calculate the volume and surface area of the cube along the edge. But it is necessary to take into account that if the user enters not a number, the program should give another attempt ... Please write how to do it without errors
#include <iostream> #include <cstdlib> using namespace std; int main() { int a, V, S; setlocale(0, ""); { cout << "Введите длину ребра куба: "; cin >> a; } V = a * a * a; S = (a * a) * 6; cout << "\nV=" << V; cout << "\nS=" << S << endl; system("PAUSE"); while(1) { if (isNumber(a)) break; else cin >> a; } }