String 11
string soz = Console.ReadLine();
string juap = ""; // string tipinde ozgeriwshi dagazalaw
for (int i = 0; i < soz.Length - 1; i++)
{
juap += soz[i] + " "; // juwap ozgeriwshige probel menen qozip bariw
}
juap += soz[soz.Length - 1];
Console.WriteLine(juap);
Console.ReadKey();
Text 9
string s = File.ReadAllText(@"a.txt"); // s ozgeriwshige a.txt faylin oqitiw
int k=int.Parse(Console.ReadLine()); // k sanin kiritiw
string a = "", b =""; // a ham b ozgeriwshisin dagazalaw
for (int i = 0; i < k; i++)
{
a += s[i]; // a ozgeriwshige qosip bariw
}
a += " ";
for (int i = k; i < s.Length; i++)
{
b += s[i]; // b ozgeriwshige qosip bariw
}
File.WriteAllText(@"a.txt", a+b); // a.txt faylina (a+b)ni jaziw
Console.WriteLine(a+b);
Do'stlaringiz bilan baham: |