ABC335A - 202<s>3</s>

problem link

Simply string modification problem. Just input a string variable and change the last character to 4

#include
#include
#include
#include
#include
using namespace std;
inline int read()
{
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0' || ch>'9'){if(ch=='-')w-=1;ch=getchar();}
	while(ch>='0' && ch<='9')s=(s<<3)+(s<<1)+(ch^48),ch=getchar();
	return s*w;
}
int main()
{
	string s;
	cin>>s;
	s[s.length()-1]='4';
	cout<<s<<endl;
	return 0;
}

你可能感兴趣的:(题解,AtCoder,算法)