Keresés


Toplista

Toplista
  • betöltés...

Magántanár kereső

Ha szívesen korrepetálnál, hozd létre magántanár profilodat itt.
Ha diák vagy és korrepetálásra van szükséged, akkor regisztrálj be és írd meg itt, hogy milyen tantárgyban!

C# programozási házi

446
Hogyan kell megcsinálni C# formában
Jelenleg 1 felhasználó nézi ezt a kérdést.
0
Középiskola / Egyéb

Válaszok

1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{

String c = Console.ReadLine();
char[] chr = c.ToCharArray();
for(int i= 1;i< c.Length; i++)
{
char[] chr2 = new char[50];
Array.ConstrainedCopy(chr, 0, chr2, 0, c.Length -i);

Console.WriteLine(""+new string(chr2));
}
Console.WriteLine("Ennyiszer irta ki: " + c.Length);





int[] tomb = new int[25];
for(int i = 0,z = 0;i< 25; i++,z++)
{
if(z == 21 && i < 25)
{
z = 1;
}
tomb[i] = z;
}

String a = "";
for(int i = 0;i< tomb.Length; i++)
{
a = a + tomb[i] + " ";
}
String b = "";
int mennyiseg = 0;
for(int i = 0; i< tomb.Length; i++)
{
if(tomb[i] >10 && tomb[i]%3 == 0)
{
b = b + tomb[i]+",";
mennyiseg++;
}
}

Console.WriteLine(a);
Console.WriteLine(b);
Console.WriteLine("ennyi volt: " +mennyiseg);
Console.Read();
}


}



}

1