- 博客(12)
- 收藏
- 关注
原创 Mac 版本向日葵退出登录账号
找遍整个软件,Mac 版本的向日葵甚至逆天到没有提供退出登录的功能…最后重启向日葵即可达到类似全新安装的效果。
2025-01-02 16:32:15
2327
2
原创 使用 DFS 解决排列数字问题并使用 pythontutor 可视化
给定一个整数n,将数字1∼n排成一排,将会有很多种排列方法。现在,请你按照字典序将所有的排列方法输出。
2023-06-25 17:12:12
331
1
原创 01 背包问题解析与代码 python 实现
给定一堆具有不同重量w1w2⋯wn与价值v1v2⋯vn的背包(knapsack),在总重量为 W 的情况下,如何选取背包才能获得最大价值?其中每种背包只能有被选取和不被选取两种选择。
2023-06-21 11:36:21
678
原创 在 jupyter notebook 中如何指定使用指定 GPU 进行训练?
在 jupyter notebook 中如何指定使用指定 GPU 进行训练?
2022-08-16 15:17:01
10008
5
原创 3. 编写程序实现如下功能:打开指定的文本文件,在每一行前加行号。
#include<fstream>#include<iostream>using namespace std;int main(int){ ifstream inf; inf.open("abc.txt"); ofstream outf; outf.open("abc_back.txt"); char c; /*noskipws => no skip whitespace(空白)noskipws 不是不忽略输入前的空格, 而是 不忽略.
2020-12-27 15:51:01
5272
原创 2.定义一个车(Vehicle)类,有run,stop等成员函数, 由此派生出自行车(bicycle)类、汽车(motocar)类,由bicycle类和motocar类派生出摩托车类(motocycl
#include<iostream>using namespace std;/*2.定义一个车(Vehicle)类,有run,stop等成员函数,由此派生出自行车(bicycle)类、汽车(motocar)类,由bicycle类和motocar类派生出摩托车类(motocycle),它们都run, stop等成员函数,编写相应的虚函数并测试。*/class Vehicle {public: virtual void run() { cout << "run .
2020-12-16 13:46:21
9236
1
原创 浙大PTA 习题6-3 使用函数输出指定范围内的完数(20 分)
#include <stdio.h>int factorsum( int number );void PrintPN( int m, int n ); int main(){ int i, m, n; scanf("%d %d", &m, &n); if ( factorsum(m) == m ) printf("%d is a perfect number\n", m); if ( factorsum(n) == n ) prin.
2020-08-29 11:05:24
1247
1
原创 习题6-1 分类统计字符个数 (15分) 本题要求实现一个函数,统计给定字符串中英文字母、空格或回车、数字字符和其他字符的个数。
我写的代码如下void StringCount( char s[] ){ int letter = 0, blank = 0, digit = 0, other = 0, i; int n = strlen(s); for ( i=0; i<n; i++ ) { if ( (s[i]>='a'&&s[i]<='z') || (s[i]>='A'&&s[i]<='Z') ) l...
2020-07-06 22:23:52
18817
5
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人