1
C#多个局部变量声明
using System;class Demo {static void Main() {int a = 20, b = 70, c = 40, d = 90;Console.WriteLine({0} {1} {2} {3}, a, b, c, d);
2
C#阶乘示例
using System;namespace MyApplication {class Factorial {public int display(int n) {int res = 1;while (n != 1) {
3
C#二进制字符串转换为整型
using System;class Program {static void Main() {string str = 1001;Console.WriteLine(Integer:+ConvertClass.Convert(str));
4
C#计算字符串中单词的出现次数
using System;class Program {static void Main() {string str = Hello World! Hello!;Console.WriteLine(Occurrence:+Check.CheckOccurrences(str, Hello));
5
C#计算字符串中的单词数
using System;public class Demo {public static void Main() {int a = 0 , myWord = 1;string str = Hello World!;