Find Your Solution Here

Codeforces

codeforces solution 514A – Chewbaсca and Number

Problem link—514A – Chewbaсca and Number
/*

Harun-or-Rashid

CSEDU-23rd Batch

*/

By coder_87, contest: Codeforces Round #291 (Div. 2), problem: (A) Chewbaсca and Number, Accepted, #


#include <bits/stdc++.h>

using namespace std;

int main()
{
    char s[20];
    int i;
    scanf("%s",s);
    if(s[0]>52&&s[0]!=57)
        s[0]=57-s[0]+48;
    for(i=1;i<strlen(s);i++){
        if(s[i]>52)
        s[i]=57-s[i]+48;
    }
    printf("%s\n",s);
    return 0;
}

Leave a Reply