Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // taskA.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <fstream>
- int _tmain(int argc, _TCHAR* argv[])
- {
- std::ifstream ifs("input.txt");
- int N, M, C=0;
- char ch;
- ifs >> N >> M >> ch;
- if (ch == 'S')
- C = M + 2;
- else if (ch == 'W')
- C = M + 1;
- if (C > N) C = N;
- std::cout << C <<std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement