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