Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
pyramidnos
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int n=5; int pyramidchar = 1; int numtoprint=1; char spaceChar = '*'; for(int row=1;row <=n;row++) { int space = (2*n-1-pyramidchar)/2; for(int col=1;col<=space;col++) { Console.Write(spaceChar); } int k = 1; bool printNumber = true; while(k <= pyramidchar) { if(printNumber) { Console.Write(numtoprint); numtoprint++; } else { Console.Write(spaceChar); } printNumber = !printNumber; k++; } for(int col=1;col<=space ;col++) { Console.Write(spaceChar); } pyramidchar = pyramidchar+2; Console.WriteLine(); } } } }
run
|
edit
|
history
|
help
0
655+99
functional program
problem version 2
SortedDictionary<TKey, TValue> クラス
codejam1a1
Chest Interaction Unity
quick sort final
Pascal Tringle
Project01
Insertion Sort