- 博客(4)
- 收藏
- 关注
原创 防止scanf读取格式与输入流不同,导致垃圾值的做法
#include <stdio.h> int main(){ int t; int a, b; t=scanf("%d%*c%d", &a, &b); if (t==2){ printf("%d %d\n", a, b); } else{ printf("error occurred in allocation"); } return 0; } 12 f...
2020-04-10 16:02:10 188
原创 使用python找出所有成等比的序列
t=[1,2,7,9,10,14,18,20] x={} for i in t: x[i]=[] for i in range(len(t)-1): for j in range(i+1,len(t)): if t[j]%t[i]==0: x[t[i]].append(t[j]) print(x) res=[] def dfs(start,...
2020-04-05 13:23:52 297
原创 C语言冒泡排序实现
#include <stdio.h> #include <stdlib.h> int main() { int i[8]={1,3,8,3,2,7,-4,8}; int j =0; int k; int temp; for(k=7;k>=0;k--){ j=0; while (j<k){ ...
2020-03-24 21:08:26 101
原创 Python if else 范围探讨
for i in range(10): if i>8: pass if i<5: pass else: print(i) 输出为 5,6,7,8,9 for i in range(10): if i>8: pass elif i<5: pas...
2020-03-24 01:30:46 600
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人