poj1552
来源:互联网 发布:2000年中国农民工数据 编辑:程序博客网 时间:2024/05/22 00:25
#include <stdio.h>
int a[15];
int twice(int a[],int num)
{
int count = 0;
int i,j,temp;
if(num == 0)
{
printf("%d/n",num);
return 0;
}
for(i=0;i<num;i++)
for(j=i+1;j<num;j++)
if(a[i] > a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
for(i=0;i<num;i++)
for(j=i+1;j<num;j++)
{
if(a[i]*2 == a[j])
count++;
}
printf("%d/n",count);
return 0;
}
int main()
{
int n;
int i=0;
scanf("%d",&n);
while(n != -1)
{
if(n != 0)
{
a[i++] = n;
scanf("%d",&n);
}
else
{
twice(a,i);
scanf("%d",&n);
i = 0;
}
}
return 0;
}
- poj1552
- poj1552
- poj1552
- POJ1552
- poj1552
- poj1552
- poj1552(水题)
- poj1552--Doubles
- poj1552-double
- 【POJ1552】:Doubles
- poj1552 Doubles
- poj1552——Doubles
- ZOJ 1760 &&POJ1552 Doubles (模拟)
- 北大暑假训练计划—POJ1552 Doubles(C语言)
- 剪切摘记
- 几千字记载着我跟她的过去,泪不断的涌出
- poj2864
- python的类、基类、多态、取消基类
- [转] VC实现进程遍历的四种方法
- poj1552
- Tomcat + 花生壳的JSP建站经验(原创)
- SQL Server 查询分析器快捷键集合
- 一旋踵66
- 第五章 走得太远别忘了回家的路(1) ——《箴言》第三章 Windows运行机理之读书笔记
- 哈哈哈哈!
- Nokia的J2ME资源库
- 程序员办网站创业,几个问题你想好了吗?
- 30岁还没有创业成功的原因