HDU 5980 Find Small A
来源:互联网 发布:北京洪浪网络诈骗案 编辑:程序博客网 时间:2024/06/06 11:42
Find Small A
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 349 Accepted Submission(s): 175
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
397 24929 100
Sample Output
3
Source
2016ACM/ICPC亚洲区大连站-重现赛(感谢大连海事大学)
Recommend
wange2014 | We have carefully selected several similar problems for you: 5981 5979 5977 5976 5975
题意:给出一个32位进制的数字,把分为8进制的数字,求有一个97
#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;int a[100];int main(){ int n,m,i,j,k; while(scanf("%d",&n)!=EOF) { int sum=0; while(n--) { scanf("%d",&m); memset(a,0,sizeof(a)); k=0; while(m) { a[k++]=m%2; m=m/2; } for(i=0;i<k;i=i+8) { int ans=0; int q=1; for(j=i;j<i+8;j++) { ans+=q*a[j]; q=q*2; } if(ans==97) sum++; ans=0; } } printf("%d\n",sum); } return 0;}
0 0
- hdu 5980 Find Small A
- HDU 5980 Find Small A
- Hdu-5980-Find Small A
- HDU 5980 Find Small A
- HDU 5980 Find Small A
- hdu 5980 Find Small A
- hdu-5980-Find Small A
- HDU 5980 Find Small A(水题)
- HDU 5980 - Find Small A(思维)
- Find Small A [HDU-5980] (水)
- hdu 5980 Find Small A(位操作)
- HDU-5980 Find Small A(位运算)
- HDU 5980 Find Small A(对二进制理解)
- hdu 5980 · Find Small A【位运算】【手速题】
- HDU 5980 && 2016ICPC大连 J: Find Small A
- hdu 5980 Find Small A(位运算思维)
- hdu 5980 Find Small A(二进制位运算)
- hdoj 5980 Find Small A
- 欢迎使用CSDN-markdown编辑器
- Maven 插件之maven-compiler-plugin
- 修改KindEditor图片批量上传数量和大小限制
- 软工总结
- 字符转换(随笔)
- HDU 5980 Find Small A
- ant 使用指南
- DOS命令大全总结
- linux向用户发送消息
- Deep Learning论文选读
- vector动态二维数组
- Eclipse导入java项目@Override报错
- [linux]raw socket example
- 字符串逆序之---句子逆序