Find Small A

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

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
 
Source
 
Recommend
 
 
 #include <bits/stdc++.h>
using namespace std; int main()
{
int n;
int t;
unsigned int a;
int i;
int sum; while (~scanf("%d", &n)) {
sum = ;
for (i = ; i < n; ++i) {
scanf("%d", &t);
a = t;
sum = sum + (((a & 0x000000ff) == ) ? : );
a >>= ;
sum = sum + (((a & 0x000000ff) == ) ? : );
a >>= ;
sum = sum + (((a & 0x000000ff) == ) ? : );
a >>= ;
sum = sum + (((a & 0x000000ff) == ) ? : );
}
printf("%d\n", sum);
} return ;
}
 
 

hdu 5980 Find Small A(水,模拟)的更多相关文章

  1. HDU 5980 Find Small A (水题)

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

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

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

  3. CodeForces.158A Next Round (水模拟)

    CodeForces.158A Next Round (水模拟) 题意分析 校赛水题的英文版,坑点就是要求为正数. 代码总览 #include <iostream> #include &l ...

  4. CodeForces.71A Way Too Long Words (水模拟)

    CodeForces71A. Way Too Long Words (水模拟) 题意分析 题怎么说你怎么做 没有坑点 代码总览 #include <iostream> #include & ...

  5. HDU 5268 ZYB loves Score (简单模拟,水)

    题意:计算Bestcoder四题的得分. 思路:直接模拟,4项分数直接计算后输出.注意不要低于百分之40的分. //#include <bits/stdc++.h> #include &l ...

  6. HDU 3682 水模拟

    n*n*n的图形,m条线,每条线上的方格被删除.问一共删除了多少个方格 ans=m*n .然后推断一下直线相交的交点.去重就可以 #include "stdio.h" #inclu ...

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

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

  8. HDU 5949 Relative atomic mass 【模拟】 (2016ACM/ICPC亚洲区沈阳站)

    Relative atomic mass Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Oth ...

  9. HDU 5102 The K-th Distance(模拟)

    题意:输入一棵树,输出前k小的点对最短距离dis(i,j)的和. 模拟,官方题解说得很清楚了.不重复了. http://bestcoder.hdu.edu.cn/ 需要注意的是,复杂度要O(n+k), ...

随机推荐

  1. java 多线程 day01 创建线程

    线程,即代码的执行路径java 面向对象编程.所以线程在java中也是用对象来表示的,创建线程对象的类就是 Thread如下代码即开启一个新的线程,通过线程对象的start方法,即可启动线程 Thre ...

  2. openPOWERLINK代码在vs2008下编译

    以openPOWERLINK_V1.08为例: 1.在主目录下新建Build目录 2.使用cmake-gui对代码进行配置 3.配置完成后生成工程文件xxx.sln 4.使用vs2008打开上述文件, ...

  3. SVM学习笔记(二)----手写数字识别

    引言 上一篇博客整理了一下SVM分类算法的基本理论问题,它分类的基本思想是利用最大间隔进行分类,处理非线性问题是通过核函数将特征向量映射到高维空间,从而变成线性可分的,但是运算却是在低维空间运行的.考 ...

  4. PScc

      photoshop cc 2018破解版是Adobe公司最新版专业化CC图像处理软件,新功能超乎你的想象!photoshop cc 2018破解版新功能给力来袭,访问Lightroom照片,分享作 ...

  5. Centos学习笔记1-基本部分

    1:查看系统的使用状态: 谁在线:who 网络连接状态:netstat  –a 后台执行程序:ps –aux 2:关机 关机:shutdown   或者 shutdown –h now 重启:rebo ...

  6. Php DOMDocument 中的 formatOutput

    Nicely formats output with indentation and extra space 是否处理 缩进和多余的空白符

  7. Android MVP Presenter 中引发的空指针异常

    一.概述 最近对 googlesamples/android-architecture 中的 MVP-dagger 进行了学习.对照项目的 MVP-dagger 分支,对 MVP-dagger 进行了 ...

  8. POJ 2253 Frogger (Dijkstra变型)

    题意:求点1到点2的路径中,权值最大的那条边,其最小值是多少. 分析:最大值最小化.可以将迪杰斯特拉模板中的松弛操作加以修改,在O(n^2)的时间内解决该问题.其中需要注意的是,dist[i]指的是: ...

  9. spring boot Rabbitmq集成,延时消息队列实现

    本篇主要记录Spring boot 集成Rabbitmq,分为两部分, 第一部分为创建普通消息队列, 第二部分为延时消息队列实现: spring boot提供对mq消息队列支持amqp相关包,引入即可 ...

  10. linux mkisofs(genisoimage)命令用法

    功能说明:建立ISO 9660映像文件. 常用命令:genisoimage -o imagename.iso file 语 法:mkisofs [-adDfhJlLNrRTvz][-print-siz ...