fork download
  1. #include <iostream>
  2. #include <queue>
  3. #include <algorithm>
  4. #include <stack>
  5. #include <string>
  6. #include <cmath>
  7. #include <vector>
  8. #include <map>
  9. #include <set>
  10. #include <sstream>
  11. #include <cstring>
  12. #include <iomanip>
  13. #include <list>
  14. #include <stdio.h>
  15. #include <stdlib.h>
  16.  
  17. #define ll long long
  18. #define sz size()
  19.  
  20. using namespace std;
  21.  
  22. int arr[100000], n;
  23.  
  24. void Shell_Sort()
  25. {
  26. for (int gap = n / 2; gap >= 1; gap /= 2){
  27. for (int x = gap; x < n; x++){
  28. if (arr[x] < arr[x - gap]){
  29. int tmp = arr[x];
  30. int i = x;
  31. while (i > 0 && tmp < arr[i-gap]){
  32. arr[i] = arr[i-gap];
  33. i = i - gap;
  34. }
  35. arr[i] = tmp;
  36. }
  37. }
  38. }
  39. }
  40. /// 1 3 7 8 5
  41.  
  42. int main()
  43. {
  44. cin >> n;
  45. for (int x = 0; x < n; cin >> arr[x++]);
  46. Shell_Sort();
  47. for (int x = 0; x < n; cout << arr[x++] << ' ');
  48. return 0;
  49. }
  50.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(2,0): error CS1024: Wrong preprocessor directive
prog.cs(3,0): error CS1024: Wrong preprocessor directive
prog.cs(4,0): error CS1024: Wrong preprocessor directive
prog.cs(5,0): error CS1024: Wrong preprocessor directive
prog.cs(6,0): error CS1024: Wrong preprocessor directive
prog.cs(7,0): error CS1024: Wrong preprocessor directive
prog.cs(8,0): error CS1024: Wrong preprocessor directive
prog.cs(9,0): error CS1024: Wrong preprocessor directive
prog.cs(10,0): error CS1024: Wrong preprocessor directive
prog.cs(11,0): error CS1024: Wrong preprocessor directive
prog.cs(12,0): error CS1024: Wrong preprocessor directive
prog.cs(13,0): error CS1024: Wrong preprocessor directive
prog.cs(14,0): error CS1024: Wrong preprocessor directive
prog.cs(15,0): error CS1024: Wrong preprocessor directive
prog.cs(16,0): error CS1024: Wrong preprocessor directive
prog.cs(18,0): error CS1025: Single-line comment or end-of-line expected
prog.cs(19,0): error CS1025: Single-line comment or end-of-line expected
prog.cs(20,6): error CS1041: Identifier expected, `namespace' is a keyword
prog.cs(20,19): error CS1001: Unexpected symbol `;', expecting identifier
prog.cs(22,8): error CS1514: Unexpected symbol `[', expecting `.' or `{'
prog.cs(22,9): warning CS0658: `value' is invalid attribute target. All attributes in this attribute section will be ignored
prog.cs(28,14): error CS1525: Unexpected symbol `<'
Compilation failed: 21 error(s), 1 warnings
stdout
Standard output is empty