PASSHACK - Editorial

Problem link :
https://www.codechef.com/ABCC2020/problems/PASSHACK

Author :

aimon123

Explanation:

The portal shows every digit by adding two .So if you substract two from every digit , you can find every digit of password.

Solution in CPP :

#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define precise cout.precision(10); cout << fixed;
#define endl “\n”
#define int int64_t
#define ll long long
#define yes printf(“YES\n”)
#define no printf(“NO\n”)
#define push_back pb
int32_t main()
{
/#ifndef ONLINE_JUDGE
freopen("/media/AIMON/SSDVol/Progs/CodeForces/input.txt", “r”, stdin);
freopen("/media/AIMON/SSDVol/Progs/CodeForces/output.txt", “w”, stdout);
#endif
/
int i,t,c;
cin>>t;
while(t–)
{
string s;
cin>>s;
for(i=0;i<s.size();i++)
{
c=s[i]-‘0’;
c-=2;
cout<<c;
}
cout<<endl;
}
}