fork download
  1. // start
  2.  
  3.  
  4. #include <cmath>
  5. #include <cstdio>
  6. #include <iostream>
  7. #include <string>
  8. using namespace std;
  9.  
  10. void Sort(string[] left, string[] right) {
  11.  
  12. }
  13.  
  14. int main() {
  15. // number of words that will be censored
  16. int numCensoredWords;
  17. //unordered_set<string> censoredWords;
  18. cin >> numCensoredWords;
  19. if (cin.fail()) {
  20. cout << "Bad input " << numCensoredWords << endl;
  21. cin.clear();
  22. }
  23. else
  24. {
  25. string* censoredWords = new (nothrow) string[numCensoredWords];
  26. if (censoredWords == nullptr) {
  27. cout << "Cannot allocate " << numCensoredWords << " strings." << endl;
  28. }
  29. else
  30. {
  31. for (int i = 0; i < numCensoredWords; i++)
  32. {
  33. cin >> censoredWords[i];
  34. }
  35. // sort our array. We'll use mergesort
  36.  
  37. delete[] censoredWords;
  38. }
  39. }
  40. int a;
  41. cin >> a;
  42. return 0;
  43. }
  44.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:10:20: error: expected ‘,’ or ‘...’ before ‘left’
 void Sort(string[] left, string[] right) {
                    ^~~~
stdout
Standard output is empty