Full speed ahead 2021.9.11 Life 187 1 分钟 周六,终于读完了薛兆丰经济学讲义,这周与往常一样,运动,学习(还稍微欠缺),娱乐。减肥有了效果,体重从160到了130多,一切朝着好的方向发展。…… 阅读更多 »
读《薛兆丰经济学讲义》 2021.9.11 Note 3563 8 分钟 你会发现⼈类⾯临着四⼤基本约束:东西不够,⽣命有限,互相依赖,需要协调。⼈类社会的种种现象和制度安排,⽆⼀不是为了适应这四种基本约束⽽衍⽣出来的。…… 阅读更多 »
Go ashore_16 2021.9.10 Note 623 2 分钟 1.函数int MySum(int m,int n);功能是求俩个正整数参数m到n之间(包括m,n)所有偶数和 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #include<iostream> using namespace std; int MySum(int m,int n) { int sum = 0; for(int i = m;i <= n;i ++ ) { if(i%2==0) sum += i; } return sum; } int main() { int m,n; cin>>m>>n; cout<<MySum(m,n); return 0; } …… 阅读更多 »
Go ashore_17 2021.9.9 Note 1072 3 分钟 1.输入a,b,c,输出最大值 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include<iostream> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if(a>b) { if(a>c) cout<<a; else cout<<c; } else { if(b>c) cout<<b; else cout<<c; } return 0; } …… 阅读更多 »
Go ashore_18 2021.9.8 Note 1184 3 分钟 1.输入俩个正整数a和b,输出a和b之间的全部素数(每5个换一行) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #include<iostream> #include<cmath> using namespace std; int main() { int a,b,i,j,cnt = 0; cin>>a>>b; for(i = a;i < b;i ++ ) { for(j = 2;j < sqrt(i);j ++ ) if(i%j==0) break; if(j>sqrt(i)) { cout<<i<<" "; cnt++; if(cnt==5) { cout<<endl; cnt = 0; } } } return 0; } …… 阅读更多 »