fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int [] ByASCII()
  5. {
  6.  
  7. }
  8.  
  9. string [] PrintSecondaryDiameter()
  10. {
  11. int i,j,k=0;
  12. string res[4];
  13. for (i = 0 ;i<4;i++)
  14. for (j = 0 ;j<4;j++)
  15. if (((i + j)-1) = 4)
  16. {
  17. res[k] = Alpha[i][j];
  18. k++;
  19. }
  20. cout<<res;
  21. }
  22.  
  23. string [] PrintMainDiameter()
  24. {
  25. int i,j,k=0;
  26. string res[4];
  27. for (i = 0 ;i<4;i++)
  28. for (j = 0 ;j<4;j++)
  29. if (i = j)
  30. {
  31. res[k] = Alpha[i][j];
  32. k++;
  33. }
  34. cout<<res;
  35. }
  36.  
  37. void Print()
  38. {
  39. int i,j;
  40. for (i = 0 ;i<4;i++)
  41. for (j = 0 ;j<4;j++)
  42. {
  43. cout<<Alpha[i][j];
  44. }
  45. }
  46. int main() {
  47. string Alpha[4][4];
  48. Alpha[0][0]="A";Alpha[0][1]="B";Alpha[0][2]="C";Alpha[0][3]="D";
  49. Alpha[1][0]="E";Alpha[1][1]="F";Alpha[1][2]="G";Alpha[1][3]="H";
  50. Alpha[2][0]="I";Alpha[2][1]="J";Alpha[2][2]="K";Alpha[2][3]="L";
  51. Alpha[3][0]="M";Alpha[3][1]="N";Alpha[3][2]="O";Alpha[3][3]="P";
  52.  
  53. print();
  54. cout<<PrintMainDiameter();
  55. cout<<PrintSecondaryDiameter();
  56. return 0;
  57. }
  58.  
  59.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:5: error: expected unqualified-id before ‘[’ token
 int [] ByASCII()
     ^
prog.cpp:9:8: error: expected unqualified-id before ‘[’ token
 string [] PrintSecondaryDiameter()
        ^
stdout
Standard output is empty