- 分享
无聊的代码
- 2025-1-19 21:40:12 @
1.转大写字母(特大写)
#include<bits/stdc++.h>
#define br break
using namespace std;
char
A[5][6]={
" # ",
" # # ",
" ### ",
"# #",
"# #"},
B[5][6]={
"#### ",
"# #",
"#### ",
"# #",
"#### "},
C[5][6]={
" ####",
"# ",
"# ",
"# ",
" ####"},
D[5][6]={
"#### ",
"# #",
"# #",
"# #",
"#### "},
E[5][6]={
"#####",
"# ",
"#####",
"# ",
"#####"},
F[5][6]={
" ###",
" # ",
" ####",
" # ",
"# "},
G[5][6]={
" ### ",
"# ",
"# ##",
"# #",
" ### "},
H[5][6]={
" # #",
" # #",
" ### ",
"# # ",
"# # "},
I[5][6]={
" ### ",
" # ",
" # ",
" # ",
" ### "},
J[5][6]={
" ###",
" # ",
" # ",
"# # ",
" ## "},
K[5][6]={
"# #",
"# # ",
"### ",
"# # ",
"# #"},
L[5][6]={
" # ",
" # ",
"# ",
"# ",
"#####"},
M[5][6]={
" # # ",
" # # ",
"# # #",
"# # #",
"# #"},
N[5][6]={
"# #",
"## #",
"# # #",
"# ##",
"# #"},
O[5][6]={
" ### ",
"# #",
"# #",
"# #",
" ### "},
P[5][6]={
" ## ",
" # #",
" ### ",
" # ",
"# "},
Q[5][6]={
" ## ",
"# # ",
"# # ",
"# # ",
" ## #"},
R[5][6]={
"#### ",
"# #",
"#### ",
"# # ",
"# #"},
S[5][6]={
" ### ",
"# ",
" ### ",
" #",
" ### "},
T[5][6]={
"#####",
" # ",
" # ",
" # ",
" # "},
U[5][6]={
"# #",
"# #",
"# #",
"# #",
" ### "},
V[5][6]={
"# #",
"# #",
" # # ",
" # # ",
" # "},
W[5][6]={
"# # #",
"# # #",
"## ##",
"## ##",
"# #"},
X[5][6]={
"# #",
" # # ",
" # ",
" # # ",
"# #"},
Y[5][6]={
"# #",
" # # ",
" # ",
" # ",
" # "},
Z[5][6]={
"#####",
" # ",
" # ",
" # ",
"#####"},
ju[5][6]={
" ",
" ",
" ",
" ## ",
" ## "},
ou[5][6]={
" ",
" ",
" ## ",
" ## ",
" # "}
;
void coutq(char c_[ ]){
for(int i=0;i<5;i++){
cout << c_[i];
}
cout << ' ';
}
void out(string c){
int cs=c.size();
for(int i=0;i<5;i++){
for(int j=0;j<cs;j++){
switch(c[j]){
case('A'):coutq(A[i]);br;
case('B'):coutq(B[i]);br;
case('C'):coutq(C[i]);br;
case('D'):coutq(D[i]);br;
case('E'):coutq(E[i]);br;
case('F'):coutq(F[i]);br;
case('G'):coutq(G[i]);br;
case('H'):coutq(H[i]);br;
case('I'):coutq(I[i]);br;
case('J'):coutq(J[i]);br;
case('K'):coutq(K[i]);br;
case('L'):coutq(L[i]);br;
case('M'):coutq(M[i]);br;
case('N'):coutq(N[i]);br;
case('O'):coutq(O[i]);br;
case('P'):coutq(P[i]);br;
case('Q'):coutq(Q[i]);br;
case('R'):coutq(R[i]);br;
case('S'):coutq(S[i]);br;
case('T'):coutq(T[i]);br;
case('U'):coutq(U[i]);br;
case('V'):coutq(V[i]);br;
case('W'):coutq(W[i]);br;
case('X'):coutq(X[i]);br;
case('Y'):coutq(Y[i]);br;
case('Z'):coutq(Z[i]);br;
case('.'):coutq(ju[i]);br;
case(','):coutq(ou[i]);br;
case(' '):cout<<" ";br;
}
}
cout << endl;
}
}
int main(){
string x;
getline(cin,x);
int u=x.size();
for(int i=0;i<u;i++){
if(x[i]>='a' & x[i]<='z') x[i]-=32;
}
out(x);
}
2 comments
-
leixinhang2012 LV 8 @ 2025-1-25 14:03:42
#include"njx.cpp" long long a,b,c,d; string aa; char sb[5]={'+','-','*','/','%'},bb; int rand_(int l,int r){//随机数函数 std::srand(static_cast<unsigned int>(std::time(nullptr))); int random_num = std::rand() % r + l; return random_num; } void answer(bool lan){ a=rand(); bb=sb[rand_(0,5)]; b=rand(); while(bb=='/'&&a/b*b!=a) { b=rand(); } if(lan==0)cout<<"This is a exercise please answer"<<endl<<a<<bb<<b; else cout << "这是一个练习,请回答"<<endl<<a<<bb<<b; cin>>d; string y[2]={"You are excellent.","你太棒了。"}; string h[2]={"Are you a person robot? ha ha ha","您是人机吗?哈哈哈"}; if(bb=='+'&&a+b==d) { cout<<y[lan]; } else if(bb=='+')cout<<h[lan]; else if(bb=='-'&&a-b==d) { cout<<y[lan]; } else if(bb=='-') cout<<h[lan]; else if(bb=='*'&&a*b==d) { cout<<y[lan]; } else if(bb=='*') cout<<h[lan]; else if(bb=='/'&&a/b==d) { cout<<y[lan]; } else if(bb=='/') cout<<h[lan]; else if(bb=='%'&&a%b==d) { cout<<y[lan]; } else if(bb=='%') cout<<h[lan]; Sleep(2000); }
-
2025-1-24 8:40:12@
- 1