📄 pku2665.java
字号:
import java.io.*;
import java.util.*;
public class Main
{
public static void main(String[] args) throws Exception
{
Scanner cin=new Scanner(System.in);
long L,M,temp;
int i;
while(true)
{
L=cin.nextInt();
M=cin.nextInt();
if(M==0&&L==0) break;
for(i=0,temp=L+1;i<M;i++)
{
temp+=cin.nextInt();
temp-=cin.nextInt();
temp-=1;
}
System.out.println(temp);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -