P1100 高低位切换

这个题很简单

直接用左移位(<<)和右移位(>>)就可以过了

#include<iostream>
#include<cstdio>
using namespace std;
unsigned int n,a,b,c;//用long long你就废了
int main()
{
    cin>>n;
    a=n<<16;//左移16位
    b=n>>16;//右移16位
    c=a+b;
    cout<<c<<endl;//输出
    return 0;
}

几行就完事了,一开始我写的十分臭长,还没A,后来看了看书,看到了这个神奇的东西,我又学到了新知识(。^▽^)

posted @ 2020-05-08 13:44  zjy123  阅读(151)  评论(0编辑  收藏  举报
//需要jquery插件 /* 鼠标特效 */ var a_idx = 0; jQuery(document).ready(function($) { $("body").click(function(e) { var a = new Array("(❤ ω ❤)","(☆▽☆)","(●'◡'●)","(✿◡‿◡)","(*^_^*)","O(∩_∩)O","( •̀ ω •́ )✧","(o゚v゚)ノ","(~ ̄▽ ̄)~","((≧∇≦)ノ","φ(゜▽゜*)♪","U•ェ•*U"); var $i = $("").text(a[a_idx]); a_idx = (a_idx + 1) % a.length; var x = e.pageX, y = e.pageY; $i.css({ "z-index": 999999999999999999999999999999999999999999999999999999999999999999999, "top": y - 20, "left": x, "position": "absolute", "font-weight": "bold", "color": "rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")" }); $("body").append($i); $i.animate({ "top": y - 180, "opacity": 0 }, 1500, function() { $i.remove(); }); }); });