using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace HelloWorld
{
	public class Program
	{
		public static void Main(string[] args)
		{
		//	Console.WriteLine("Hello, World!"+sizeof(DirectionalLightData));
				Console.WriteLine("DirectionalLightData "+System.Runtime.InteropServices.Marshal.SizeOf<DirectionalLightData>());
					Console.WriteLine("LightData "+System.Runtime.InteropServices.Marshal.SizeOf<LightData>());
					Console.WriteLine("EnvLightData "+System.Runtime.InteropServices.Marshal.SizeOf<EnvLightData>());
					Console.WriteLine("HDShadowData "+System.Runtime.InteropServices.Marshal.SizeOf<HDShadowData>());
					Console.WriteLine("HDDirectionalShadowData "+System.Runtime.InteropServices.Marshal.SizeOf<HDDirectionalShadowData>());
					Console.WriteLine("ShaderVariablesGlobal "+System.Runtime.InteropServices.Marshal.SizeOf<ShaderVariablesGlobal>());
		}
		
struct LightData
{
    float3 positionRWS;
    uint lightLayers;
    float lightDimmer;
    float volumetricLightDimmer;
    float angleScale;
    float angleOffset;
    float3 forward;
    float iesCut;
    int lightType;
    float3 right;
    float penumbraTint;
    float range;
    int cookieMode;
    int shadowIndex;
    float3 up;
    float rangeAttenuationScale;
    float3 color;
    float rangeAttenuationBias;
    float4 cookieScaleOffset;
    float3 shadowTint;
    float shadowDimmer;
    float volumetricShadowDimmer;
    int nonLightMappedOnly;
    float minRoughness;
    int screenSpaceShadowIndex;
    float4 shadowMaskSelector;
    float4 size;
    int contactShadowMask;
    float diffuseDimmer;
    float specularDimmer;
    float __unused__;
    float2 padding;
    float isRayTracedContactShadow;
    float boxLightSafeExtent;
};

	
		struct DirectionalLightData
{
    float3 positionRWS;
    uint lightLayers;
    float lightDimmer;
    float volumetricLightDimmer;
    float3 forward;
    int cookieMode;
    float4 cookieScaleOffset;
    float3 right;
    int shadowIndex;
    float3 up;
    int contactShadowIndex;
    float3 color;
    int contactShadowMask;
    float3 shadowTint;
    float shadowDimmer;
    float volumetricShadowDimmer;
    int nonLightMappedOnly;
    float minRoughness;
    int screenSpaceShadowIndex;
    float4 shadowMaskSelector;
    float2 cascadesBorderFadeScaleBias;
    float diffuseDimmer;
    float specularDimmer;
    float penumbraTint;
    float isRayTracedContactShadow;
    float distanceFromCamera;
    float angularDiameter;
    float flareFalloff;
    float flareCosInner;
    float flareCosOuter;
    float __unused__;
    float3 flareTint;
    float flareSize;
    float3 surfaceTint;
    float4 surfaceTextureScaleOffset;
};


struct EnvLightData
{
    uint lightLayers;
    float3 capturePositionRWS;
    int influenceShapeType;
    float3 proxyExtents;
    float minProjectionDistance;
    float3 proxyPositionRWS;
    float3 proxyForward;
    float3 proxyUp;
    float3 proxyRight;
    float3 influencePositionRWS;
    float3 influenceForward;
    float3 influenceUp;
    float3 influenceRight;
    float3 influenceExtents;
    float3 blendDistancePositive;
    float3 blendDistanceNegative;
    float3 blendNormalDistancePositive;
    float3 blendNormalDistanceNegative;
    float3 boxSideFadePositive;
    float3 boxSideFadeNegative;
    float weight;
    float multiplier;
    float rangeCompressionFactorCompensation;
    float roughReflections;
    float distanceBasedRoughness;
    int envIndex;
    float4 L0L1;
    float4 L2_1;
    float L2_2;
    int normalizeWithAPV;
    float2 padding;
};


struct ShaderVariablesGlobal{

Matrix4x4 _ViewMatrix;
    Matrix4x4 _CameraViewMatrix;
    Matrix4x4 _InvViewMatrix;
    Matrix4x4 _ProjMatrix;
    Matrix4x4 _InvProjMatrix;
    Matrix4x4 _ViewProjMatrix;
    Matrix4x4 _CameraViewProjMatrix;
    Matrix4x4 _InvViewProjMatrix;
    Matrix4x4 _NonJitteredViewProjMatrix;
    Matrix4x4 _PrevViewProjMatrix;
    Matrix4x4 _PrevInvViewProjMatrix;
    float4 _WorldSpaceCameraPos_Internal;
    float4 _PrevCamPosRWS_Internal;
    float4 _ScreenSize;
    float4 _PostProcessScreenSize;
    float4 _RTHandleScale;
    float4 _RTHandleScaleHistory;
    float4 _RTHandlePostProcessScale;
    float4 _RTHandlePostProcessScaleHistory;
    float4 _DynamicResolutionFullscreenScale;
    float4 _ZBufferParams;
    float4 _ProjectionParams;
    float4 unity_OrthoParams;
    float4 _ScreenParams;
    float4 _FrustumPlanes;
    float4 _FrustumPlanes1;
    float4 _FrustumPlanes2;
    float4 _FrustumPlanes3;
    float4 _FrustumPlanes4;
    float4 _FrustumPlanes5;
    float4 _ShadowFrustumPlanes;
    float4 _ShadowFrustumPlanes1;
    float4 _ShadowFrustumPlanes2;
    float4 _ShadowFrustumPlanes3;
    float4 _ShadowFrustumPlanes4;
    float4 _ShadowFrustumPlanes5;
    float4 _TaaFrameInfo;
    float4 _TaaJitterStrength;
    float4 _Time;
    float4 _SinTime;
    float4 _CosTime;
    float4 unity_DeltaTime;
    float4 _TimeParameters;
    float4 _LastTimeParameters;
    int _FogEnabled;
    int _PBRFogEnabled;
    int _EnableVolumetricFog;
    float _MaxFogDistance;
    float4 _FogColor;
    float _FogColorMode;
    float _GlobalMipBias;
    float _GlobalMipBiasPow2;
    float _Pad0;
    float4 _MipFogParameters;
    float4 _HeightFogBaseScattering;
    float _HeightFogBaseExtinction;
    float _HeightFogBaseHeight;
    float _GlobalFogAnisotropy;
    int _VolumetricFilteringEnabled;
    float2 _HeightFogExponents;
    int _FogDirectionalOnly;
    float _FogGIDimmer;
    float4 _VBufferViewportSize;
    float4 _VBufferLightingViewportScale;
    float4 _VBufferLightingViewportLimit;
    float4 _VBufferDistanceEncodingParams;
    float4 _VBufferDistanceDecodingParams;
    uint _VBufferSliceCount;
    float _VBufferRcpSliceCount;
    float _VBufferRcpInstancedViewCount;
    float _VBufferLastSliceDist;
    float4 _ShadowAtlasSize;
    float4 _CascadeShadowAtlasSize;
    float4 _AreaShadowAtlasSize;
    float4 _CachedShadowAtlasSize;
    float4 _CachedAreaShadowAtlasSize;
    int _ReflectionsMode;
    int _UnusedPadding0;
    int _UnusedPadding1;
    int _UnusedPadding2;
    uint _DirectionalLightCount;
    uint _PunctualLightCount;
    uint _AreaLightCount;
    uint _EnvLightCount;
    int _EnvLightSkyEnabled;
    uint _CascadeShadowCount;
    int _DirectionalShadowIndex;
    uint _EnableLightLayers;
    uint _EnableSkyReflection;
    uint _EnableSSRefraction;
    float _SSRefractionInvScreenWeightDistance;
    float _ColorPyramidLodCount;
    float _DirectionalTransmissionMultiplier;
    float _ProbeExposureScale;
    float _ContactShadowOpacity;
    float _ReplaceDiffuseForIndirect;
    float4 _AmbientOcclusionParam;
    float _IndirectDiffuseLightingMultiplier;
    uint _IndirectDiffuseLightingLayers;
    float _ReflectionLightingMultiplier;
    uint _ReflectionLightingLayers;
    float _MicroShadowOpacity;
    uint _EnableProbeVolumes;
    uint _ProbeVolumeCount;
    float _SlopeScaleDepthBias;
    float4 _CookieAtlasSize;
    float4 _CookieAtlasData;
    float4 _ReflectionAtlasCubeData;
    float4 _ReflectionAtlasPlanarData;
    uint _NumTileFtplX;
    uint _NumTileFtplY;
    float g_fClustScale;
    float g_fClustBase;
    float g_fNearPlane;
    float g_fFarPlane;
    int g_iLog2NumClusters;
    uint g_isLogBaseBufferEnabled;
    uint _NumTileClusteredX;
    uint _NumTileClusteredY;
    int _EnvSliceSize;
    uint _EnableDecalLayers;
    Matrix4x4 _ShapeParamsAndMaxScatterDists0;
    Matrix4x4 _ShapeParamsAndMaxScatterDists1;
    Matrix4x4 _ShapeParamsAndMaxScatterDists2;
    Matrix4x4 _ShapeParamsAndMaxScatterDists3;
    Matrix4x4 _TransmissionTintsAndFresnel0;
    Matrix4x4 _TransmissionTintsAndFresnel1;
    Matrix4x4 _TransmissionTintsAndFresnel2;
    Matrix4x4 _TransmissionTintsAndFresne3;
    Matrix4x4 _WorldScalesAndFilterRadiiAndThicknessRemaps0;
    Matrix4x4 _WorldScalesAndFilterRadiiAndThicknessRemaps1;
    Matrix4x4 _WorldScalesAndFilterRadiiAndThicknessRemaps2;
    Matrix4x4 _WorldScalesAndFilterRadiiAndThicknessRemaps3;
    uint _EnableSubsurfaceScattering;
    uint _TexturingModeFlags;
    uint _TransmissionFlags;
    uint _DiffusionProfileCount;
    float2 _DecalAtlasResolution;
    uint _EnableDecals;
    uint _DecalCount;
    float _OffScreenDownsampleFactor;
    uint _OffScreenRendering;
    uint _XRViewCount;
    int _FrameCount;
    float4 _CoarseStencilBufferSize;
    int _IndirectDiffuseMode;
    int _EnableRayTracedReflections;
    int _RaytracingFrameIndex;
    uint _EnableRecursiveRayTracing;
    int _TransparentCameraOnlyMotionVectors;
    float _GlobalTessellationFactorMultiplier;
    float _SpecularOcclusionBlend;
    float _DeExposureMultiplier;
    float4 _ScreenSizeOverride;
    float4 _ScreenCoordScaleBias;
	};

struct HDShadowData
    {
        public float3 rot0;
        public float3 rot1;
        public float3 rot2;
        public float3 pos;
        public float4 proj;

        public float2 atlasOffset;
        public float worldTexelSize;
        public float normalBias;

        public float4 zBufferParam;
        public float4 shadowMapSize;

        public float4 shadowFilterParams0;

        public float3 cacheTranslationDelta;
        public float isInCachedAtlas;

        public Matrix4x4 shadowToWorld;
    }

 public struct Matrix4x4
  {
  public float m00;
    public float m10;
    
    public float m20;
  
    public float m30;
  
    public float m01;
  
    public float m11;
  
    public float m21;
  
    public float m31;
  
    public float m02;
  
    public float m12;
    
    public float m22;
    public float m32;
    public float m03;
    public float m13;
    public float m23;

    public float m33;
  }

struct HDDirectionalShadowData
    {
        // We can't use Vector4 here because the vector4[] makes this struct non blittable
        public Matrix4x4 sphereCascades;

        public float4 cascadeDirection;

        public float4 cascadeBorders;
    }

public struct float2{
  public float a;
  public float b;
}
public struct float3{
  public float a;
  public float b;
  public float c;
}
public struct float4{
  public float a;
  public float b;
  public float c;
  public float d;
}
	}
} 

C Sharp Online Compiler

Write, Run & Share C# code online using OneCompiler's C# online compiler for free. It's one of the robust, feature-rich online compilers for C# language, running on the latest version 8.0. Getting started with the OneCompiler's C# compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as C# and start coding.

Read inputs from stdin

OneCompiler's C# online compiler supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample program which takes name as input and print your name with hello.

using System;
 
namespace Sample
{
  class Test
    {
      public static void Main(string[] args)
       {
         string name;
         name = Console.ReadLine();
         Console.WriteLine("Hello {0} ", name);
	}
     }
}

About C Sharp

C# is a general purpose object-oriented programming language by Microsoft. Though initially it was developed as part of .net but later it was approved by ECMA and ISO standards.

You can use C# to create variety of applications, like web, windows, mobile, console applications and much more using Visual studio.

Syntax help

Data types

Data TypeDescriptionRangesize
intTo store integers-2,147,483,648 to 2,147,483,6474 bytes
doubleto store large floating point numbers with decimalscan store 15 decimal digits8 bytes
floatto store floating point numbers with decimalscan store upto 7 decimal digits4 bytes
charto store single characters-2 bytes
stringto stores text-2 bytes per character
boolto stores either true or false-1 bit

Variables

Syntax

datatype variable-name = value;

Loops

1. If-Else:

When ever you want to perform a set of operations based on a condition or set of few conditions IF-ELSE is used.

if(conditional-expression) {
   // code
} 
else {
   // code
}

You can also use if-else for nested Ifs and If-Else-If ladder when multiple conditions are to be performed on a single variable.

2. Switch:

Switch is an alternative to If-Else-If ladder.

switch(conditional-expression) {    
case value1:    
 // code    
 break;  // optional  
case value2:    
 // code    
 break;  // optional  
...    
    
default:     
 // code to be executed when all the above cases are not matched;    
} 

3. For:

For loop is used to iterate a set of statements based on a condition.

for(Initialization; Condition; Increment/decrement) {
  // code  
} 

4. While:

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while(condition) {
 // code 
}

5. Do-While:

Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.

do {
  // code 
} while (condition);

Arrays

Array is a collection of similar data which is stored in continuous memory addresses. Array values can be fetched using index. Index starts from 0 to size-1.

Syntax

data-type[] array-name;

Methods

Method is a set of statements which gets executed only when they are called. Call the method name in the main function to execute the method.

Syntax

static void method-name() 
{
  // code to be executed
}