fork download
  1. #include <iostream.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int i,space,rows,k=0;
  6. cin>>rows;
  7. int temp=rows+1;
  8. for(i=1;i<=temp;++i)
  9. {
  10. for(space=1;space<=temp-i;++space)
  11. {
  12. cout<<" ";
  13. }
  14. while(k!=2*i-1)
  15. {
  16. cout<<"* ";
  17. ++k;
  18. }
  19. k=0;
  20. cout<<"\n";
  21. }
  22. for(i=2;i<=temp-1;++i)
  23. {
  24. for(space=1;space<=temp-i;++space)
  25. {
  26. cout<<" ";
  27. }
  28. while(k!=2*i-1)
  29. {
  30. cout<<"* ";
  31. ++k;
  32. }
  33. k=0;
  34. cout<<"\n";
  35. }
  36. for(i=2;i<=temp-2;++i)
  37. {
  38. for(space=1;space<=temp-i;++space)
  39. {
  40. cout<<" ";
  41. }
  42. while(k!=2*i-1)
  43. {
  44. cout<<"* ";
  45. ++k;
  46. }
  47. k=0;
  48. cout<<"\n";
  49. }
  50. for(i=1;i<=2;++i)
  51. {
  52. for(space=1;space<=temp-1;++space)
  53. {
  54. cout<<" ";
  55. }
  56. while(k!=1)
  57. {
  58. cout<<"* ";
  59. ++k;
  60. }
  61. k=0;
  62. cout<<"\n";
  63. }
  64. return 0;
  65. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
4
compilation info
prog.cs(2,0): error CS1024: Wrong preprocessor directive
prog.cs(2,6): error CS1525: Unexpected symbol `namespace', expecting `identifier' or `static'
prog.cs(2,19): error CS1525: Unexpected symbol `;', expecting `identifier' or `static'
prog.cs(5,4): error CS1525: Unexpected symbol `int', expecting `identifier' or `static'
prog.cs(10,8): error CS1525: Unexpected symbol `for', expecting `identifier' or `static'
prog.cs(12,11): error CS1525: Unexpected symbol `cout', expecting `identifier' or `static'
prog.cs(13,9): error CS1514: Unexpected symbol `}', expecting `.' or `{'
Compilation failed: 7 error(s), 0 warnings
stdout
Standard output is empty