• C#中的运算(移位、异或、与、或)


    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Collections;

    namespace ConsoleApplication3
    {
        class Program
        {

            static void Main(string[] args)
            {
                ///<summary>
                /// 移位运算           
                ///</summary>
                int i = 7;
                int j = 2;
                Console.WriteLine(i >> j);   //输出结果为1

                ///<summary>
                /// 异或运算
                ///</summary>
                int x = 5;
                int y = 3;
                y ^= x;   //等价与y=y^x
                Console.WriteLine(y);        ////输出结果为6

                ///<summary>
                /// 或运算           
                ///</summary>
                int i = 7;
                int j = 2;
                Console.WriteLine(i | j);   //输出结果为7

                ///<summary>
                /// 与运算           
                ///</summary>
                int i = 7;
                int j = 2;
                Console.WriteLine(i & j);   //输出结果为2
            }
        }
    }

  • 相关阅读:
    SDL_mixer 播放wav
    SDL_mixer 播放mp3
    [转]音频基础知识及编码原理
    [转]QT父子与QT对象delete
    [转]QT中嵌入SDL
    [转]PCM文件格式
    [转]ffmpeg库音频解码示例
    C# 向PivotItem中添加子控件
    初识 Windows Phone 7
    C#语言使用Windows phone 中的数据数据绑定
  • 原文地址:https://www.cnblogs.com/tianguook/p/1717485.html
Copyright © 2020-2023  润新知