// 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;
}
Comments