poj2665

简单题

View Code
#include <iostream>
#include
<cstdlib>
#include
<cstring>
#include
<cstdio>
using namespace std;

int main()
{
//freopen("D:\\t.txt", "r", stdin);
int l, m;
while (scanf("%d%d", &l, &m) != EOF && !(l == 0 && m == 0))
{
int ans = l + 1;
for (int i = 0; i < m; i++)
{
int a, b;
scanf(
"%d%d", &a, &b);
ans
-= b - a + 1;
}
printf(
"%d\n", ans);
}
return 0;
}
posted @ 2011-05-01 12:29  金海峰  阅读(228)  评论(0编辑  收藏  举报