CodeForces-467A

https://vjudge.net/problem/CodeForces-467A

#include <iostream>
using namespace std;

int main()
{
	int pi[100];
	int qi[100];
	int x;
	cin >> x;
	int counter = 0;
	for (int i = 0; i < x; i++)
	{
		cin >> pi[i];
		cin >> qi[i];
		if (pi[i] > qi[i])
			return -1;
		if (qi[i] - pi[i] >= 2)
			counter++;
	}
	cout << counter;
}
阅读更多

没有更多推荐了,返回首页