您的位置:首页 > 其它

[HDU-5980] [Problem J]水题

2017-06-09 16:48 357 查看
这道题的题意就给你一个数字大小在2的32次方以下,  也就是说开个50左右的数组就行了, 然后判断从左边第一位开始直到第八位按照十进制的方法加起来是否等于97;
每八位是一个数字 ,统计一下有几个97;
//
// main.cpp
// 160929
//
// Created by 刘哲 on 17/5/30.
// Copyright © 2016年 my_code. All rights reserved.
//#include <bits/stdc++.h>

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <list>
#include <bitset>
#include <stack>
#include <stdlib.h>
#define lowbit(x) (x&-x)
typedef long long ll;
using namespace std;

int main()
{
int t;
while(cin>>t)
{
int ans = 0;
int a;
while(t--)
{
cin>>a;
while(a)
{
if(a%256=='a')
ans++;
a>>=8;
}
}
cout<<ans<<endl;
}

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  水题 亚洲