CCF_201409-1_相邻数对
2024-09-05 14:13:10
水。
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std; int main()
{
int n,a[];
cin >> n;
for(int i = ;i <= n;i++) cin >> a[i];
sort(a+,a+n+);
int num = ;
for(int i = ;i < n;i++)
{
if(a[i+]-a[i] == ) num++;
}
cout << num << endl;
return ;
}
最新文章
- AHCI: Failed to attach drive to Port1 (VERR_GENERAL_FAILURE).
- c++模板使用出错情况error LNK2019: unresolved external symbol ";public: float __thiscall Compare<;float>;::min(void)"; (?min@?$Compare@M@@QAEMXZ) referenced in function _main
- http协议与网页优化泛谈
- <;转>; jsp页面向action传值的方法(最后一种简单)
- JS数组(Array)操作汇总
- 使用Javascript获得网页中通过GET方法提交的参数
- JSP执行过程详解
- apk代码的破解
- 网易云课堂_程序设计入门-C语言_第四周:循环控制_2念整数
- Installutil.exe的位置和路径
- sublime 3 增加php开发插件
- Erlang调度器细节探析
- mysql之聚合函数、group by、having
- SpringCloud系列——Feign 服务调用
- 为UITextField增加MaxLength特性
- vue--组件基础
- 转://linux下hugepages理解
- Tools:apache部署https服务
- python3简单实现微信爬虫
- 解决sdk更新时候报错 http://dl-ssl.google.com/android上不去,链接拒绝