Cod sursa(job #586292)
Utilizator | Data | 30 aprilie 2011 14:23:49 | |
---|---|---|---|
Problema | Perb | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Algoritmiada 2011, Runda Finală, Clasele 5-9 | Marime | 0.32 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("perb.in");
ofstream g("perb.out");
int n,i,m,a,b;
string s;
int main () {
f >> n >> m;
getline(f,s);
for (i=1;i<=m;i++) {
f >> a >> b;
g << (b-a+1) << '\n';
}
f.close();g.close();
return 0;
}