Может ли кто-нибудь скомпилировать правильный код. Я очень новичок в программировании
public static void Main(string[] args) { // The files used in this example are created in the topic // How to: Write to a Text File. You can change the path and // file name to substitute text files of your own. // Example #1 // Read the file as one string. string text = System.IO.File.ReadAllText(@"C:\Users\VIJAY SOITAAB\Desktop\C#\Text folder\WriteText.txt"); // Display the file contents to the console. Variable text is a string. //Console.WriteLine("Contents of WriteText.txt = {0}", text); //char c = (char)127; // last ascii character char c = 'A'; if ((int)c == 127) // check for last ascii character { Console.WriteLine("Done"); } else { char result = GetNextChar(c); //Console.WriteLine("I have " + c + " it should give " + result); Console.WriteLine("Contents of WriteText.txt = {0}", text); //System.out.println(c); //Console.WriteLine("The age is " + age); // Console.ReadKey(); } } private static char GetNextChar(char c) { // convert char to ascii int ascii = (int)c; // get the next ascii int nextAscii = ascii + 1; // convert ascii to char }
Что я уже пробовал:
Чтение текстового файла и попытка вывести символы для следующих символов
Пример:
"Привет, мир"
должен выводиться как
"ifmmp xpsme"