Find Small A

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 2268    Accepted Submission(s): 1083

Problem Description
As is known to all,the ASCII of character 'a' is 97. Now,find out how many character 'a' in a group of given numbers. Please note that the numbers here are given by 32 bits’ integers in the computer.That means,1digit represents 4 characters(one character is represented by 8 bits’ binary digits).
 
Input
The input contains a set of test data.The first number is one positive integer N (1≤N≤100),and then N positive integersai (1≤ ai≤2^32 - 1) follow
 
Output
Output one line,including an integer representing the number of 'a' in the group of given numbers.
 
Sample Input
3
97 24929 100
 
Sample Output
3

关于二进制的理解应用问题,8位即2^8==256,则每个数%256若==97,则sum++

AC代码:

 #include<bits/stdc++.h>
using namespace std; int main(){
ios::sync_with_stdio(false);
int t,x;
cin>>t;
int sum=;
while(t--){
cin>>x;
while(x>){
if(x%==){
sum++;
}
x/=;
}
}
cout<<sum<<endl;
return ;
}

HDU-5980的更多相关文章

  1. HDU 5980 Find Small A(寻找小A)

    p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...

  2. hdu 5980 Find Small A(水,模拟)

    Find Small A Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Tota ...

  3. HDU 5980 Find Small A (水题)

    题意:众所周知,字符 'a' 的ASCII码为97.现在,找出给定数组中出现了多少次 'a' .注意,此处的数字为计算机中的32位整数.这表示, 1个数字由四个字符组成(一个字符由8位二进制数组成). ...

  4. 2016ACM/ICPC亚洲区大连站现场赛题解报告(转)

    http://blog.csdn.net/queuelovestack/article/details/53055418 下午重现了一下大连赛区的比赛,感觉有点神奇,重现时居然改了现场赛的数据范围,原 ...

  5. HDU 5963 朋友 【博弈论】 (2016年中国大学生程序设计竞赛(合肥))

    朋友 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem Descr ...

  6. HDU 5969 最大的位或 【贪心】 (2016年中国大学生程序设计竞赛(合肥))

    最大的位或 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem De ...

  7. HDU 5968 异或密码 【模拟】 2016年中国大学生程序设计竞赛(合肥)

    异或密码 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem Des ...

  8. HDU 5961 传递 【图论+拓扑】 (2016年中国大学生程序设计竞赛(合肥))

    传递 Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)     Problem ...

  9. HDU 5965 扫雷 【模拟】 (2016年中国大学生程序设计竞赛(合肥))

    扫雷 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submissi ...

  10. hdu 5971 Wrestling Match 判断能否构成二分图

    http://acm.hdu.edu.cn/showproblem.php?pid=5971 Wrestling Match Time Limit: 2000/1000 MS (Java/Others ...

随机推荐

  1. ios -- 极光推送《2》--极光推送消息推送成功,但是手机收不到的解决方法

    1.确认证书是否与app的Bundle ID是否一致 2. 确认你的推送证书是否已经过期 3.确认你的APP_KEY是否和极光APP_KEY是否一致 4.正确调用bindChannel,并成功返回ap ...

  2. 九度OJ 1060:完数VS盈数 (数字特性)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:5590 解决:2093 题目描述: 一个数如果恰好等于它的各因子(该数本身除外)子和,如:6=3+2+1.则称其为"完数" ...

  3. packages/wepy-web/src/wx.js 分析storage 的加载原理 wx.getStorage(OBJECT)

    是小程序实例化后 读入内存 还是每次调用从文件系统读取 https://github.com/Tencent/wepy/blob/bd0003dca2bfb9581134e1b05d4aa1d80fc ...

  4. pgsql 数据类型

  5. 剑指Offer:字符串排列【38】

    剑指Offer:字符串排列[38] 题目描述 输入一个字符串,按字典序打印出该字符串中字符的所有排列.例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bc ...

  6. JS中继承方式总结

    说在前面:为了使代码更为简洁方便理解, 本文中的代码均将"非核心实现"部分的代码移出. 一.原型链方式关于原型链,可点击<深入浅出,JS原型链的工作原理>,本文不再重复 ...

  7. 解决/usr/bin/ld: cannot find -lmysqlclient错误

    类似/usr/bin/ld: cannot find -xxxx的错误有很多, 首先我们可以最简单的判断一下: 这类情况一般是由于缺乏某某库文件, 又或者可能是由于已存在的库问题版本不对造成的 一般都 ...

  8. SDOI 2017 Day1

    日期:2017-04-10 题解: 第一题: 题目大意:求fi(gcd(i,j))的乘积  i,j属于[1,1e6],数据组数1000组. 类别:套路题. 第二题:BZOJ原题. 题解:LCT套线段树 ...

  9. poj 2336 Ferry Loading II ( 【贪心】 )

    Ferry Loading II Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3704   Accepted: 1884 ...

  10. BZOJ(begin) 1328 [Usaco2003 Open]Jumping Cows:贪心【波峰波谷模型】

    题目链接:http://begin.lydsy.com/JudgeOnline/problem.php?id=1328 题意: 给你一个长度为n的正整数序列. 可以选任意个数字,只能从左往右选. 偶数 ...