using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace reverse_file
{
class Program
{
static void Main(string[] args)
{
string path = "input.txt";
StreamReader sr = new StreamReader(path);
string s = sr.ReadToEnd();
foreach (var item in s)
{
Console.Write(item);
}
char[] arr = s.ToCharArray();
Array.Reverse(arr);
foreach (var item in arr)
{
Console.Write(item);
}
// or
//string[] srr = s.Split(' ');
//Array.Reverse(srr);
//foreach (var item in srr)
//{
// Console.WriteLine(item);
//}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace reverse_file
{
class Program
{
static void Main(string[] args)
{
string path = "input.txt";
StreamReader sr = new StreamReader(path);
string s = sr.ReadToEnd();
foreach (var item in s)
{
Console.Write(item);
}
char[] arr = s.ToCharArray();
Array.Reverse(arr);
foreach (var item in arr)
{
Console.Write(item);
}
// or
//string[] srr = s.Split(' ');
//Array.Reverse(srr);
//foreach (var item in srr)
//{
// Console.WriteLine(item);
//}
}
}
}
// This program is created by Jaspreet Singh
0 comments:
Post a Comment