Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
static void Main(String[] args) {
string S = Console.ReadLine();
int thenumber;
try {
public static Node insert(Node head,int data)
{
//Complete this method
if(head == null)
return new Node( data);
else if(head.next == null){
head.next = new Node(data);
}
else{
insert(head.next,data);
class Student : Person{
private int[] testScores;
public Student(string firstName, string lastName, int identification, int[] scores) {
this.firstName = firstName;
this.lastName = lastName;
this.id = identification;
this.testScores = scores;
}
public string calculate() {
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
static void Main(String[] args) {
int[][] arr = new int[6][];
for(int arr_i = 0; arr_i < 6; arr_i++){
string[] arr_temp = Console.ReadLine().Split(' ');
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
static void Main(String[] args) {
int n = Convert.ToInt32(Console.ReadLine());
string thebinary = Convert.ToString(n, 2);
char[] binaryArray = thebinary.ToCharArray();
using System;
using System.Collections.Generic;
using System.IO;
class Solution {
static int factorial(int thenumber) {
if(thenumber <= 1) {
return 1;
} else {
return thenumber * factorial(thenumber-1);
}
@dzsquared
dzsquared / operators.cs
Created December 30, 2016 02:45
operators created by dzsquared - https://repl.it/Ewyl/0
using System;
using System.Collections.Generic;
using System.IO;
class MealCalculator {
static void Main(String[] args) {
double mealCost;
int tipPercent;
int taxPercent;
@dzsquared
dzsquared / conditions.cs
Created December 30, 2016 02:45
conditions created by dzsquared - https://repl.it/Ewyo/0
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
static void Main(String[] args) {
int N = Convert.ToInt32(Console.ReadLine());
if (N%2 == 0) {
if(N >= 2 && N<= 5) {
@dzsquared
dzsquared / class example.cs
Created December 30, 2016 02:45
class example created by dzsquared - https://repl.it/Ewys/0
class Person {
public int age;
public Person(int initialAge) {
// Add some more code to run some checks on initialAge
if (initialAge < 0) {
Console.WriteLine("Age is not valid, setting age to 0.");
this.age = 0;
} else {
this.age = initialAge;
}
@dzsquared
dzsquared / arrays and loops.cs
Created December 30, 2016 02:44
arrays and loops created by dzsquared - https://repl.it/Ewyw/0
using System;
using System.Collections.Generic;
using System.IO;
class Solution {
static void Main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */
int lineCount;
lineCount = Convert.ToInt32(Console.ReadLine());
for(int i = 1; i <= lineCount; i++) {
string theword = Console.ReadLine();