fork download
  1. #include "iostream"
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int x, y, z,ilosc,karne;
  8. cout << "Wprwadz przedzial: ";
  9. cin >> x >> y; "\n";
  10. cout << "Wprowadz ilosc rzutow: ";
  11. cin >> ilosc;
  12. cout << endl;
  13.  
  14. for (int i = 0; i <= ilosc; i++)
  15. {
  16. cout << "Wprowadz liczbe: ";
  17. cin >> z;
  18. if (z >= x && z <= y)
  19. {
  20. cout << "BINGO" << endl;
  21. karne = 0;
  22. }
  23. else if (z < x)
  24. {
  25.  
  26. cout << "Minus: " << karne = x - z << " pkt." << endl;
  27. }
  28. else
  29. {
  30. cout << "Minus: " << karne = y - z << " pkt." << endl;
  31. }
  32. cout << karne << endl;
  33. }
  34.  
  35. system("pause");
  36. return 0;
  37. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:26:40: error: invalid operands of types ‘int’ and ‘const char [6]’ to binary ‘operator<<’
     cout << "Minus: " << karne = x - z << " pkt." << endl;
                                  ~~~~~~^~~~~~~~~~
prog.cpp:30:40: error: invalid operands of types ‘int’ and ‘const char [6]’ to binary ‘operator<<’
     cout << "Minus: " << karne = y - z << " pkt." << endl;
                                  ~~~~~~^~~~~~~~~~
stdout
Standard output is empty