3 solutions
-
0
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int j=0; int n=1; for(int i=0;i<s.size()-1;i++){ if(s[i]=='-') ; else{ j+=(s[i]-'0')*n; n++; } } j%=11; if(j==s[12]-'0') cout<<"Right"; else if(j==10&&s[12]=='X') cout<<"Right"; else{ s.pop_back(); if(j==10) cout<<s<<'X'; else cout<<s<<j; } return 0; }
Information
- ID
- 102
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- (None)
- # Submissions
- 262
- Accepted
- 52
- Uploaded By