1 solutions
-
0
C++ :
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int a=1,c=0; for(int i=0;i<s.size()-1;i++) { if(isdigit(s[i])) { c=c+(s[i]-'0')*a; a++; } } c=c%11; char f; if(c<10) { f=c+'0'; } else { f='X'; } string m=s; m[m.size()-1]=f; if(m==s) printf("Right"); else { cout << m; } return 0; }
- 1
Information
- ID
- 9183
- Time
- 1000ms
- Memory
- 50MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By