Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream fin("alo.in");
- ofstream fout("alo.out");
- int main()
- {
- int E, Nr, D, N, i;
- fin >> E>> N;
- for (i=1; i<=N; i++){
- fin >> Nr>> D;
- if (Nr%10+(Nr/10000*10)==15){
- E=E-D*2;
- }
- if (Nr%10+(Nr/10000*10)==25){
- E=E+D;
- }
- }
- fout << E;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement