7 条题解
-
5
兄弟们,暴力出奇迹啊
已AC,请放心食用👀️
( •̀ ω •́ )✧
#include <iostream> using namespace std; int main() { string n; cin >> n; for (int i = 0; i < n.length(); i++) { if (n[i] == 'O') { n[i] = 0; } else if (n[i] == 'l') { cout << 1; } else if (n[i] == 'Z') { cout << 2; } else if (n[i] == 'S') { cout << 5; } else if (n[i] == 'b') { cout << 6; } else if (n[i] == 'B') { cout << 8; } else if (n[i] == 'q') { cout << 9; } else { cout << n[i]; } } return 0; }
显示这个,你就做对了
foo.cc: In function 'int main()': foo.cc:7:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare] for (int i = 0; i < n.length(); i++) ~~^~~~~~~~~~~~
-
4
啊...暴力出奇迹👀️
c++代码:
#include <bits/stdc++.h> using namespace std; int main() { string a; cin >> a; for (int i = 0; i < a.length(); i++) { if (a[i] == 'O') cout << 0; else if (a[i] == 'l') cout << 1; else if (a[i] == 'Z') cout << 2; else if (a[i] == 'S') cout << 5; else if (a[i] == 'b') cout << 6; else if (a[i] == 'B') cout << 8; else if (a[i] == 'q') cout << 9; else cout << a[i]; } return 0; }
python代码:
a = input() for i in a: if (i == "O"): print(0,end = "") elif (i == "l"): print(1,end = "") elif (i == "Z"): print(2,end = "") elif (i == "S"): print(5,end = "") elif (i == "b"): print(6,end = "") elif (i == "B"): print(8,end = "") elif (i == "q"): print(9,end = "") else: print(i,end = "")
都已AC,放心食用
-
3
#include <iostream> #include <string> using namespace std; int main() { string a; getline(cin, a); for (int i = 0; i < a.size(); i++) { if (a[i] == 79) { a[i] = 48; } if (a[i] == 108) { a[i] = 49; } if (a[i] == 90) { a[i] = 50; } if (a[i] == 83) { a[i] = 53; } if (a[i] == 98) { a[i] = 54; } if (a[i] == 66) { a[i] = 56; } if (a[i] == 113) { a[i] = 57; } } cout << a; return 0; }
-
2
#include <bits/stdc++.h> using namespace std; char s; int main() { while(cin>>s) { if(s=='O') cout<<0; else if(s=='l') cout<<1; else if(s=='Z') cout<<2; else if(s=='S') cout<<5; else if(s=='b') cout<<6; else if(s=='B') cout<<8; else if(s=='q') cout<<9; else cout<<s; } return 0; }
-
2
纯粹暴力扫描
#include <iostream> using namespace std; int main(){ string s; cin>>s; for(int i=0;i<s.length();i++){ if(s[i]=='O')s[i]='0'; else if(s[i]=='l')s[i]='1'; else if(s[i]=='Z')s[i]='2'; else if(s[i]=='S')s[i]='5'; else if(s[i]=='b')s[i]='6'; else if(s[i]=='B')s[i]='8'; else if(s[i]=='q')s[i]='9'; } cout<<s<<endl; return 0; }
-
1
又是狂写if的一天(〃'▽'〃)
#include <iostream> #include <cstring> using namespace std; string a; int main() { cin>>a; for(int i=0;i<a.length();i++){ //把数字0错误地识别为大写字母O if(a[i]=='O') cout<<0; //把数字1错误地识别为小写字母l else if(a[i]=='l') cout<<1; //把数字2错误地识别为大写字母Z else if(a[i]=='Z') cout<<2; //把数字5错误地识别为大写字母S else if(a[i]=='S') cout<<5; //把数字6错误地识别为小写字母b else if(a[i]=='b') cout<<6; //把数字8错误地识别为大写字母B else if(a[i]=='B') cout<<8; //把数字9错误地识别为小写字母q else if(a[i]=='q') cout<<9; //正常输出 else cout<<a[i]; } return 0; }
- 1
信息
- ID
- 100
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 1
- 标签
- 递交数
- 110
- 已通过
- 76
- 上传者