fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main ()
  4. {
  5. int a, somma=0;
  6. bool decimale=false;
  7. cin>>a;
  8.  
  9. if (a == -1)
  10. {
  11. cout<<"VUOTO";
  12. }
  13. else
  14. {
  15. while (a != -1)
  16. {
  17. somma=(somma*10)+a;
  18.  
  19. if (a>=0 && a<=9)
  20. decimale=true;
  21.  
  22. cin>>a;
  23. }
  24.  
  25. if (decimale==false)
  26. cout<<"ERRORE";
  27.  
  28. if else (decimale==true && somma%3==0)
  29. cout<<somma<<"SI";
  30. else
  31. cout<<somma<<"NO";
  32. }
  33.  
  34. return 0;
  35. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:28:6: error: expected '(' after 'if'
                if else (decimale==true && somma%3==0)
                   ^
prog.cpp:30:3: error: expected expression
                else
                ^
2 errors generated.
stdout
Standard output is empty