| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 74408 | 林Qmay | 位运算 | C++ | Compile Error | 0 | 0 MS | 0 KB | 622 | 2023-05-22 20:02:27 |
#include <bits/stdc++.h> using namespace std; char s[1000]; bool flag = false; int main() { freopen("bit.in","r",stdin); freopen("bit.out","w",stdout); scanf("%s",s + 1); int sizee = strlen(s + 1); for (int i = sizee; i >= 1; i--){ if (s[i] != '0'){ s[i]--; break; } } for (int i = 1; i <= sizee; i++){ if (!flag && s[i] != '0'){ flag = 1; } if (flag){ printf("%c",s[i]); } if (!flag){ printf("0"); printf("\n"); } return 0; }