Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Buktep
Problemset: ครัวซองค์รสซีซาร์
Language: cpp
Time: 0.003 second
Submitted On: 2025-09-26 09:25:05
#include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
int n; cin>>n;
cin.ignore();
string str;
getline(cin, str);
for(int i=0;i<(int)str.length();i++)
{
if(str[i]>='A' and str[i] <='Z')
{
if(str[i] - n < 'A')
{
str[i] = (char)('Z' + (str[i] - 'A') - n + 1);
}
else
{
str[i] = (char)(str[i] - n);
}
}
else if(str[i]>='a' and str[i]<='z')
{
if(str[i] - n < 'a')
{
str[i] = (char)('Z' + (str[i] - 'A') - n + 1);
}
else
{
str[i] = (char)(str[i] - n);
}
}
cout<<str[i];
}
return 0;
}