fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. Console.WriteLine("Hello World!");
  8.  
  9. string firstFriend = "れんちゃん";
  10. string secondFriend = "Sage";
  11. Console.WriteLine($"My friends are {firstFriend} and {secondFriend}");
  12.  
  13.  
  14. Console.WriteLine($"The name {firstFriend} has {firstFriend.Length} letters.");
  15. Console.WriteLine($"The name {secondFriend} has {secondFriend.Length} letters.");
  16.  
  17.  
  18.  
  19. //文字数を返してるのクマったくまった
  20. //byt数を返す様に変更 Error CS1073: Unexpected token ';' (CS1073) (Sample)
  21.  
  22. int new_game01 = System.Text.Encoding.GetEncoding(932).GetByteCount(firstFriend);
  23. Console.WriteLine(string.Format("firstFriend,{0}のbyt数は", firstFriend) + new_game01.ToString());
  24.  
  25. }
  26. }
Success #stdin #stdout 0.05s 17060KB
stdin
Standard input is empty
stdout
Hello World!
My friends are れんちゃん and Sage
The name れんちゃん has 5 letters.
The name Sage has 4 letters.
firstFriend,れんちゃんのbyt数は10