摘要: import turtle as t t.pensize(4)#设置画笔宽度 #t.hideturtle()#隐藏画笔 t.colormode(255)#颜色模式设为rgb模式 t.speed(10)#设置画笔速度 t.home()#初始化画笔位置(原点)、方向(东) def draw_nose(): t.color((255, 155, 192), "pink") t.pe... 阅读全文
posted @ 2019-09-01 22:27 zhanghua-01 阅读(163) 评论(0) 推荐(0) 编辑
摘要: size=7 #创建一个size*size的二维列表 array=[[0]*size] for i in range(size-1): array+=[[0]*size] #orient 代表转圈方向 #0代表向下,1代表向右,2代表向左,3代表向上 orient=0 #i控制行索引,j控制列索引 i=j=0 #k为需要存入二维数组的数 for num in range(1,size*s... 阅读全文
posted @ 2019-08-15 11:28 zhanghua-01 阅读(134) 评论(0) 推荐(0) 编辑
摘要: han_list=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"] unit_list=["拾","佰","仟"] #把整数部分和小数部分转化为字符串,并存入元组作为返回值 def devide(num): integer=int(num)#整数部分 fraction=round((num-integer 阅读全文
posted @ 2019-08-14 13:35 zhanghua-01 阅读(884) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; int main() { const int max = 1000000; char str[max]; char num[max / 10]; stringstream ss; int n, i, j; string ans = ""; queueq; cin.getline(num... 阅读全文
posted @ 2019-08-05 13:13 zhanghua-01 阅读(258) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main() { int i, j,n; string s1, s2,a1,a2; cin >> i >> j; cin >> s1 >> s2; a1 = s1[i-1]; a2 = s2[i-1]; for (n = i-1; n < j; n++) { a1 += s1[n]; a2 += s2[n... 阅读全文
posted @ 2019-08-05 13:12 zhanghua-01 阅读(247) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main() { char str[30]; cin.getline(str, 30); cout << str << endl; return 0; } 阅读全文
posted @ 2019-08-05 13:12 zhanghua-01 阅读(62) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; void is_HuiWenShu(int c) { int n = 0; int m = c; while (m != 0) { n = n * 10 + m%10; m = m / 10; } if (n == c) cout > a >> b; num = a + b; is_HuiWenShu(nu... 阅读全文
posted @ 2019-08-05 13:11 zhanghua-01 阅读(92) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main() { int i, len,n; string s; cin >>n>> s; len = s.length(); for (i = 0; i = 'A' && s[i] = 'a' && s[i] = 'A' && s[i] 'Z') { s[i] -= 26; } } el... 阅读全文
posted @ 2019-08-05 13:10 zhanghua-01 阅读(190) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int main() { string s; cin >> s; vector v(52, 0); for (int i = 0; i = 'A' && s[i] = 'a' && s[i] = 26) { temp = i - 26 + 97; } else { temp = i + ... 阅读全文
posted @ 2019-08-05 13:09 zhanghua-01 阅读(91) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int gcd(int a, int b) { if (b == 0) return a; else return gcd(b, a % b); } int main() { int a, b,i,j,k=0; cin >> a >> b; if ... 阅读全文
posted @ 2019-08-05 13:06 zhanghua-01 阅读(122) 评论(0) 推荐(0) 编辑