您的位置:首页 > 其它

poj 2665

2014-11-08 17:06 155 查看
//poj 2665 小学生题 种树题
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;

int main()
{
int n, m;
cin>>n;
cin>>m;
while( n != 0 && m != 0)
{
int start, end;
n = n+1;
for(int i = 0; i < m; i++)
{
cin>>start>>end;
n -= (end - start + 1);
}
cout<<n<<endl;
cin>>n;
cin>>m;
}

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: