POJ.1552 Doubles(水)

题意分析

暴力

代码总览

#include <cstdio>
#include <stdio.h>
#define nmax 100
using namespace std;
int a[nmax];
int n;
int main()
{
//freopen("in.txt","r",stdin);
while(true){
int t;
scanf("%d",&t);
if(t == -1) break;
if(t == 0){
printf("0\n");
continue;
}else{
int cnt = 0;
a[cnt++] =t;
while(scanf("%d",&t) && t!= 0){
a[cnt++] = t;
}
int ans = 0;
for(int i = 0; i<cnt;++i){
for(int j = 0; j<cnt;++j){
if(i == j) continue;
else{
if(a[j] == 2* a[i]) ans++;
}
}
}
printf("%d\n",ans);
}
}
return 0;
}

POJ.1552 Doubles(水)的更多相关文章

  1. Poj 1552 Doubles(水题)

    一.Description As part of an arithmetic competency program, your students will be given randomly gene ...

  2. POJ 1552 Doubles (C++ STL set使用)

    题目: 题意:题意:给出几个正数(2~15个),然后就是求有这些数字的2倍有没有和原先的正数相同的,求出有几个,没有就是0. 分析:水题.用数组解决,开一个数组存正数,另开一个数组用来存这些数的2倍, ...

  3. poj 1552 Doubles

    #include <stdio.h> #include <stdlib.h> ]; int cmp(const void *a, const void *b) { return ...

  4. 【转】POJ百道水题列表

    以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...

  5. POJ.1003 Hangover ( 水 )

    POJ.1003 Hangover ( 水 ) 代码总览 #include <cstdio> #include <cstring> #include <algorithm ...

  6. POJ 3050 Hopscotch 水~

    http://poj.org/problem?id=3050 题目大意: 在一个5*5的格子中走,每一个格子有个数值,每次能够往上下左右走一格,问走了5次后得到的6个数的序列一共同拥有多少种?(一開始 ...

  7. poj 3264 RMQ 水题

    题意:找到一段数字里最大值和最小值的差 水题 #include<cstdio> #include<iostream> #include<algorithm> #in ...

  8. POJ 1836 Alignment 水DP

    题目: http://poj.org/problem?id=1836 没读懂题,以为身高不能有相同的,没想到排中间的两个身高是可以相同的.. #include <stdio.h> #inc ...

  9. POJ 1837 Balance 水题, DP 难度:0

    题目 http://poj.org/problem?id=1837 题意 单组数据,有一根杠杆,有R个钩子,其位置hi为整数且属于[-15,15],有C个重物,其质量wi为整数且属于[1,25],重物 ...

随机推荐

  1. Maxscript-获取选中文件

    Maxscript - 获取选中文件 使用 .Net 的方法弹出窗口选择文件,并范围所有选中文件的路径“” Fn Fun_GetFilePaths strTitle strFilter = ( dia ...

  2. python3爬虫-快速入门-爬取图片和标题

    直接上代码,先来个爬取豆瓣图片的,大致思路就是发送请求-得到响应数据-储存数据,原理的话可以先看看这个 https://www.cnblogs.com/sss4/p/7809821.html impo ...

  3. windows10下git一些问题

    windows10下安装git 找不到ssh解决办法 解决办法是: 输入下列命令,一路回车 $ ssh-keygen -t rsa -C “邮箱地址” 若执行ssh-add /path/to/xxx. ...

  4. CryptoZombies学习笔记——Lesson4

    第四课主要介绍payable函数相关. chapter1: payable修饰函数 以太坊允许同时调用函数和eth转账.msg.value显示发送到合约的以太币数,ether是内置整型数.如果函数没有 ...

  5. 操作系统及Python解释器工作原理讲解

    操作系统介绍 操作系统位于计算机硬件与应用软件之间 是一个协调.管理.控制计算机硬件资源与软件资源的控制程序 操作系统功能: 控制硬件 把对硬件复杂的操作封装成优美简单的接口(文件),给用户或者应用程 ...

  6. 八:The YARN Timeline Server

    一.Overview 介绍     yarn timeline server用于存储和检查应用程序过去和现在的信息(比如job history server).有两个功能: 1.Persisting ...

  7. nginx配置和网站的部署

    环境: CentOS Linux release 7.3.1611 (Core) nginx version: nginx/1.13.4 PHP 5.4.16 (cli) (built: Nov 6 ...

  8. Thunder团队——文案+美工

    团队名称:Thunder 组长:王航 成员:李传康.代秋彤.邹双黛.苗威.宋雨.胡佑蓉.杨梓瑞 项目名称:爱阅app 需求概述: 现在市面上有很多手机阅读器,但是基本上不是收费就是广告满天飞.基于这种 ...

  9. Beta阶段项目展示博客

    Beta阶段项目展示 团队成员的简介 详细见团队简介 角色 姓名 照片 项目经理,策划 游心 策划 王子铭 策划 蔡帜 美工 赵晓宇 美工 王辰昱 开发.架构师 解小锐 开发 陈鑫 开发 李金奇 开发 ...

  10. freefcw/hustoj Install Guide

    First of all, this version hustoj is a skin and improved for https://code.google.com/p/hustoj/. So t ...